Splicing-scale-adaptive structured sensitive data detection method and system

By adopting a splicing scale adaptive method in structured data detection, combined with LSTM, multi-scale sliding window and attention mechanism, the problems of detection accuracy and robustness under multi-scale changes are solved, and more efficient sensitive information recognition is achieved.

CN120804635AActive Publication Date: 2025-10-17JIANGXI POLICE COLLEGE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511300151.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-10-17
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

Existing technologies have difficulty adapting to multi-scale splicing changes in detecting sensitive information in structured data, resulting in insufficient detection accuracy and generalization ability. In particular, the model has poor robustness when the number of columns is unevenly distributed.

Method used

We employ a splicing scale adaptive method, dynamically adjusting the field length through preprocessing, and combining LSTM, multi-scale sliding window, self-attention and spatial attention mechanisms to extract multi-dimensional features for feature fusion and classification.

Benefits of technology

The model's adaptability to different splicing scales is improved, the richness of feature representation and detection accuracy are enhanced, the recognition accuracy of complex and variant-sensitive data is improved, and it shows stronger generalization ability and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804635A_ABST
    Figure CN120804635A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of artificial intelligence and data security, and discloses a splicing-scale-adaptive structured sensitive data detection method and system.The method comprises the steps that firstly, multiple fields of structured data are spliced into a text sequence through preset separators, and then character set coding is conducted to obtain a character index sequence; inputting the character index sequence into an embedded layer and a bidirectional long-short-term memory network to extract time sequence features, generating global dependency features through a self-attention mechanism module, extracting multi-scale local features by adopting a multi-scale sliding window, fusing through a gating mechanism to generate intermediate features, and obtaining spatial enhancement features through a spatial attention module; and finally, splicing the global dependency feature and the spatial enhancement feature to obtain a fusion feature. And finally, inputting the fusion features into a classifier to obtain a sensitive data category of the structured data. The method is high in splicing scale adaptability, rich in feature representation, high in detection precision and good in robustness, and is suitable for a privacy information classification scene in a structured text.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and data security, in particular to a structured sensitive data detection method and system with adaptive splicing scale based on fusion of long short-term memory network, convolutional neural network and spatial attention mechanism, and is especially suitable for the privacy information classification scene in structured text. BACKGROUND

[0002] With the acceleration of digitalization, the leakage risk of structured sensitive data is increasing. Once such data is maliciously used, it will lead to serious economic losses and social trust crisis. Therefore, efficient and accurate sensitive data detection technology has become a core demand to protect data security, which is of great significance to maintain personal privacy, enterprise compliance and national security.

[0003] The main challenge of sensitive information detection in structured data lies in its inherent context missing characteristics. Unlike traditional continuous text, table data structure presents the following key features: 1. Semantic fragmentation: data is divided into independent cells, destroying the natural semantic continuity. 2. Context sparsity: there is no explicit semantic association mechanism between cells, relying on implicit structural relationship. 3. Feature dispersion: sensitive information is often distributed in multiple fields in the form of non-continuous fragments. 4. Semantic mixed interference: a cell may contain a mixture of sensitive and non-sensitive information. The lack of multi-dimensional context modeling is the fundamental bottleneck restricting the detection accuracy and generalization ability. Therefore, the core difficulty of sensitive data detection in structured data is how to model the context.

[0004] Existing technologies generally use cell splicing strategy to reconstruct semantic association: connecting adjacent fields as continuous text sequences to simulate natural language context environment. However, this solution faces multi-scale adaptability challenges in practical applications: the number of columns of structured data presents a high degree of unevenness, and the splicing scale (i.e. the number of cell data contained in a single sample) in actual business scenarios often far exceeds the training set coverage. In this case, how to ensure the accuracy of classification results, how to ensure the generalization ability and robustness of the model to rare structural form data have become a problem to be solved. SUMMARY

[0005] Based on this, the purpose of the present application is to overcome the defects of poor adaptability to splicing scale changes and insufficient robustness of structured sensitive data detection models in the prior art, and to provide a structured sensitive data detection method and system with adaptive splicing scale.

[0006] In a first aspect, the present application provides a structured sensitive data detection method with adaptive splicing scale, comprising the following steps: S1, a data preprocessing step: obtaining structured data, splicing a plurality of fields in the structured data into a text sequence through a preset delimiter, and performing character set encoding on the text sequence to obtain a character index sequence; S2, a feature extraction and fusion step: this step includes: inputting the character index sequence into an embedding layer to obtain a character embedding sequence, and then inputting the character embedding sequence into a bidirectional long short-term memory network to extract a time sequence feature; establishing a first feature processing path, inputting the time sequence feature into a self-attention mechanism module, modeling the global dependency relationship between characters in the text sequence, and generating a global dependency feature; establishing a second feature processing path parallel to the first feature processing path, which includes: performing feature extraction on the time sequence feature using a multi-scale sliding window to obtain a multi-scale local feature; fusing the time sequence feature and the multi-scale local feature through a gating mechanism to generate an intermediate feature; inputting the intermediate feature into a spatial attention module to perform feature weighting on the intermediate feature to obtain a spatial enhanced feature; splicing the global dependency feature and the spatial enhanced feature along the feature dimension to obtain a fusion feature; S3, a classification step: inputting the fusion feature into a classifier to obtain the sensitive data category of the structured data.

[0007] As an optional implementation of the first aspect of the application, in the data preprocessing step, the plurality of fields in the structured data are spliced into a text sequence through a preset delimiter, specifically including: according to the length distribution of each field in the training data set, a splicing scale threshold λ is preset; for the field to be processed, the length of the field is judged, if the length of the field is greater than the threshold λ, the field is segmented and truncated according to the threshold λ length, and a preset special mark is added at the end of each truncated segment; if the length of the field is less than the threshold λ, the character sequence of the field is cycled, and the character sequence obtained by cycling is filled to the end of the original field until the total length of the field reaches the threshold λ.

[0008] As an optional implementation manner of the first aspect of the present application, the processing procedure of the self-attention mechanism module in the first feature processing path specifically includes: performing linear transformation on the input time sequence feature through a first projection matrix, a second projection matrix and a third projection matrix respectively to generate a query vector Q, a key vector K and a value vector V; performing matrix multiplication on the transpose of the query vector Q and the key vector K, and performing scaling processing and Softmax function normalization on the obtained result to calculate an attention weight matrix; and performing matrix multiplication on the attention weight matrix and the value vector V to obtain the globally dependent feature after weighted aggregation.

[0009] As an optional implementation manner of the first aspect of the present application, in the second feature processing path, the time sequence feature is extracted by a multi-scale sliding window to obtain a multi-scale local feature, specifically including: presetting a sliding window scale set containing at least two different integers; for each scale s in the multi-scale sliding window scale set, s / 2 zero vectors are filled at both ends of the time sequence dimension of the character embedding sequence to obtain a padded sequence; for each time step of the padded sequence, all feature vectors in the window centered at the time step and with a width of s are extracted, and a weighted sum thereof is calculated to obtain a single-scale sliding window feature under the scale s; the single-scale sliding window features obtained under all scales are spliced along the feature dimension, and then a linear transformation layer is used to compress the dimension of the spliced feature to be consistent with the hidden layer dimension of the time sequence feature to obtain the multi-scale local feature.

[0010] As an optional implementation manner of the first aspect of the present application, in the second feature processing path, the time sequence feature and the multi-scale local feature are fused by a gating mechanism to generate an intermediate feature, specifically including: splicing or performing element-wise operation on the time sequence feature and the multi-scale local feature, inputting the result into a linear layer, and then calculating an interaction weight gating value through a Sigmoid activation function ; the time sequence feature is weighted, and 1- the multi-scale local feature is weighted, and the two weighted results are added to obtain the intermediate feature.

[0011] ​As an optional implementation manner of the first aspect of the present application, in the second feature processing path, the processing procedure of the spatial attention module specifically comprises: performing average pooling operation and maximum pooling operation along the channel dimension of the intermediate feature respectively to obtain an average pooling feature descriptor and a maximum pooling feature descriptor; concatenating the average pooling feature descriptor and the maximum pooling feature descriptor along the channel dimension to form an enhanced feature descriptor; inputting the enhanced feature descriptor into a two-dimensional convolution layer configured as a single output channel and adopting zero padding for convolution operation, and then processing the convolution result through a Sigmoid activation function to generate a spatial attention mask; and multiplying the spatial attention mask and the input intermediate feature element by element to obtain the spatial enhanced feature.

[0012] As an optional implementation manner of the first aspect of the present application, in the data preprocessing step, the text sequence is encoded by a character set to obtain a character index sequence, specifically comprising: traversing the training data set, counting all characters appearing, and constructing a character-to-index mapping dictionary, wherein the character-to-index mapping dictionary is used to map the character in the text sequence to the index, and the index is used to represent the character in the text sequence. <pad>representing a fill character and a <unk>represents an unregistered character; converting each character in the text sequence to its corresponding unique index according to the mapping dictionary, if the character is not in the dictionary, then to <unk>corresponding indexes to form an initial index sequence; determining whether a length of the initial index sequence is less than a preset maximum sequence length, and if so, padding the initial index sequence with the <pad>corresponding index, until the sequence length is equal to the maximum sequence length, to obtain the character index sequence.

[0013] In a second aspect, the embodiments of the present application provide a structured sensitive data detection system with adaptive concatenation scale, comprising: A data preprocessing module is configured to obtain structured data, concatenate a plurality of fields in the structured data into a text sequence through a preset delimiter, encode the text sequence into a character set, and obtain a character index sequence. A feature extraction and fusion module is configured to input the character index sequence into an embedding layer to obtain a character embedding sequence, input the character embedding sequence into a bidirectional long short-term memory network to extract a time sequence feature, establish a first feature processing path, input the time sequence feature into a self-attention mechanism module, model global dependency relationships between characters in the text sequence, and generate a global dependency feature; a second feature processing path parallel to the first feature processing path is established, and the second feature processing path comprises: performing feature extraction on the time sequence feature using a multi-scale sliding window to obtain a multi-scale local feature; performing fusion on the time sequence feature and the multi-scale local feature through a gating mechanism to generate an intermediate feature; inputting the intermediate feature into a spatial attention module to perform feature weighting on the intermediate feature to obtain a spatial enhanced feature; and concatenating the global dependency feature and the spatial enhanced feature along a feature dimension to obtain a fusion feature. A classification module is configured to input the fusion feature into a classifier to obtain a sensitive data category of the structured data.

[0014] In a third aspect, the embodiments of the present application provide an electronic device, which comprises a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and the program or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0015] In a fourth aspect, the embodiments of the present application provide a readable storage medium, which stores a program or instructions, and the program or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0016] Compared with the prior art, the present application has the following significant advantages: 1. Strong adaptability of concatenation scale: through dynamic concatenation preprocessing, the feature sparsity problem caused by uneven field length is effectively alleviated, so that the model can better process input data of different concatenation scales.

[0017] 2. Feature representation is rich: combined with LSTM, multi-scale sliding window, spatial attention and self-attention mechanism, features are extracted from multiple dimensions such as temporal dependence, local pattern, key area and global correlation, and a comprehensive and robust feature representation is constructed.

[0018] 3. High detection accuracy: the spatial attention mechanism can focus on the key character area where sensitive information is located, and the self-attention mechanism can capture scattered context associations, and the combination of the two significantly improves the recognition accuracy of complex and variant sensitive data.

[0019] 4. Good robustness: for rare or unknown splicing forms of data with large structural differences from training data, the method shows stronger generalization ability and detection robustness through multi-modal feature fusion and double attention mechanism. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 is a flowchart of a structured sensitive data detection method with adaptive splicing scale according to an embodiment of the application; Figure 2 is a structural schematic diagram of a structured sensitive data detection system with adaptive splicing scale provided by an embodiment of the application.

[0021] The following specific embodiments will further illustrate the application in conjunction with the above drawings. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0023] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in a "or" relationship. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.

[0024] Embodiment 1 Please refer to Figure 1 A flowchart of a structured sensitive data detection method with adaptive concatenation scale provided by an embodiment of the present application. The method can include the following steps: S1, a data preprocessing step: obtaining structured data, concatenating a plurality of fields in the structured data into a text sequence through a preset delimiter, and performing character set encoding on the text sequence to obtain a character index sequence.

[0025] A preset scenario of this embodiment is to detect and classify structured sensitive data stored in a certain database in a table format. We take a column of data with the table header as Organization and the content as [Estet Interier D.O.O., Lincoln County Government, Leavitt Area High School, Town Health Corporate Advisory And Investments Limited, Cologica Scientific] as an example to illustrate the running process of the method of the present application.

[0026] Specifically, this step S1 includes the following steps: S11, data preprocessing.

[0027] Data preprocessing borrows from the mainstream structured sensitive data processing method, and a small amount of column data is connected by a specific delimiter to become a piece of text as an independent sample, wherein represents the i-th column data. Use to represent the concatenation process of the data, and a single sample can be represented as To solve the problem of multi-scale distribution caused by significant length difference of sensitive fields in structured data, a dynamic concatenation strategy is proposed. First, the length distribution of sensitive information of each field is counted, and a concatenation scale threshold λ is set (for example, λ = 0.8, which means that 80% of the field length is less than this value). For fields with length greater than λ, use the segmentation truncation + dynamic padding strategy: If the field length > λ, truncate by λ and add a special marker at the end; If the field length < λ, fill it to λ length by looping (for example, fill "abc" to "abcabc").

[0028] By dynamically adjusting the concatenation scale, the feature sparsity problem caused by uneven field length is reduced, and the adaptability of the model to multi-scale sensitive data is improved. Finally, each cell is composed of a token sequence: wherein represents one of the tokens in the cell content; The final expansion can be obtained: .

[0029] Because the length of sensitive information in different fields is significantly different, this splicing method causes the sensitive fields to present multi-scale distribution characteristics.

[0030] The processed data is in the following form: Estet Interier D.O.O.||lincoln county government||Leavitt Area HighSchool||Town Health Corporate Advisory And Investments Limited||Cologica Scientific;;;Organization.

[0031] S12, data cleaning.

[0032] It can be expected that the content at the end of some very small number of data is consistent with the separator form, eventually leading to the model identifying illegal types. This situation mainly affects the training process of the model and can cause the model to have abnormal classification. After cleaning some boundary values, this situation can be avoided.

[0033] S13, character set encoding.

[0034] Specifically includes the following parts: (1) Traverse the training data set, count all the characters that appear, and construct a character-to-index mapping dictionary.

[0035] For example, char_dict = { <pad> ':0, ' <unk>':1, 'E':2, 's':3, 't':4, ... ,';':128}; in <pad>represents a fill character (index 0), <unk>Represents an unregistered character (index 1).

[0036] (2) Sequence Indexing: Each character in the text sequence is converted to its corresponding unique index according to the mapping dictionary. If the character is not in the dictionary, it is converted to <unk>corresponding indices, forming an initial index sequence: wherein, represents a character index sequence, which is formed by converting each character in the text sequence into its corresponding unique index through a mapping dictionary, represents a character-to-index mapping function, which is used to convert a character into its corresponding index value in the dictionary, represents a character in the sequence, represents the original text sequence, represents the maximum sequence length.

[0037] For example: "Estet" → [2, 3, 4, 5, 6].

[0038] (3) Padding processing: determine whether the length of the initial index sequence is less than a preset maximum sequence length. If yes, pad <pad>corresponding index, until the sequence length equals the maximum sequence length, to obtain a character index sequence.

[0039] S2, a feature extraction and fusion step, comprising: inputting the character index sequence into an embedding layer to obtain a character embedding sequence, and inputting the character embedding sequence into a bidirectional long short-term memory network to extract a time sequence feature; establishing a first feature processing path, inputting the time sequence feature into a self-attention mechanism module, modeling the global dependency relationship between characters in the text sequence, and generating a global dependency feature; establishing a second feature processing path parallel to the first feature processing path, the path comprising: performing feature extraction on the time sequence feature using a multi-scale sliding window to obtain a multi-scale local feature; fusing the time sequence feature and the multi-scale local feature through a gating mechanism to generate an intermediate feature; inputting the intermediate feature into a spatial attention module to perform feature weighting on the intermediate feature to obtain a spatial enhanced feature; and concatenating the global dependency feature and the spatial enhanced feature along the feature dimension to obtain a fusion feature.

[0040] The process of this step S2 is as follows: S21, inputting the character index sequence into an embedding layer to obtain a character embedding sequence, and inputting the character embedding sequence into a bidirectional long short-term memory network to extract a time sequence feature.

[0041] First, the character index is mapped into a word vector in the embedding layer.

[0042] wherein represents the character embedding sequence, L is the sequence length, and D is the embedding dimension, represents mapping. Wherein is the embedding dimension, for example, 'E' → [0.12, -0.45,..., 0.87] Secondly, the bidirectional long short-term memory network (LSTM) captures the context dependency on the sequence: wherein is the hidden layer dimension of the LSTM, and each time step output contains a feature vector that is the concatenation of the forward and backward states .

[0043] S22, establishing a first feature processing path, inputting the time sequence feature into a self-attention mechanism module, modeling the global dependency relationship between characters in the text sequence, and generating a global dependency feature.

[0044] Self-attention mechanism, through the self-attention mechanism to model the global dependence between characters in the sequence, to solve the problem of sparse and scattered context information in structured data.

[0045] First, input three projection matrices, the time sequence features output by LSTM Projection into three groups of vectors: query vectors , key vectors , value vectors .

[0046] Where , , are three projection matrices, is the projection dimension, generally set .

[0047] Second, attention weight calculation: calculate position correlation through scaled dot-product.

[0048] Where represents the attention weight, represents the activation function.

[0049] For example, in the sequence "Lincoln, county, government", the attention weight of "g" to "L" is 0.08, the weight of "g" to "county" is 0.25, and the weight of "g" to other characters in "government" is 0.67, which enhances the strength of word-level language.

[0050] Subsequently, feature enhancement: use attention weight to aggregate global information .

[0051] For example, the final representation of character g is ; Finally, output the weighted aggregated global dependence features When , the self-attention mechanism part can be summarized as follows: When input "Town Health Corporate Advisory", the weight of "C" in "Corporate" to "Town" = 0.62, the weight of "A" in "Advisory" to "Corporate" = 0.58, and overall form "Town-Health-Corporate-Advisory" semantic chain.

[0052] S23: Establish a second feature processing path in parallel with the first feature processing path, the path including: (1) A multi-scale sliding window is used to extract the time series features to obtain a multi-scale local feature.

[0053] For input data , using sliding window scale set (e.g. {1, 3, 5}) to perform multi-scale sliding window feature extraction (Multi-scale Sliding Window, MSW).

[0054] First, single-scale sliding window feature extraction (for each scale ): To keep the output sequence length consistent with the input (L), The time dimension (L) is padded at both ends A zero vector is obtained Then for each time step (corresponding to the original sequence position), calculate the weighted sum of the features in the window: in For scale The window weight vector satisfies (Numerical stability). Single-scale results The same dimension as the input.

[0055] Second, multi-scale feature fusion: the results of all scales are combined Fusion is the final multi-scale sliding window output First, multi-scale features are concatenated to obtain multi-scale local features. : Where, K = | | is the number of scales. Then, the concatenated features are compressed back to H dimensions through linear transformation: in, is the learnable projection matrix.

[0056] (2) The temporal features are fused with the multi-scale local features through a gating mechanism to generate an intermediate feature.

[0057] After extracting multi-scale sliding window features, a cross-modal feature interaction module (CMI) is added to dynamically fuse LSTM time series features with multi-scale sliding window features through a gating mechanism: First, calculate the interaction weight: wherein is a learnable parameter, is a bias value, and σ is a Sigmoid function.

[0058] Secondly, multi-modal feature fusion: wherein represents an intermediate feature.

[0059] (3) The intermediate feature is input into a spatial attention module to perform feature weighting on the intermediate feature to obtain a spatial enhanced feature.

[0060] The input is then input into a subsequent spatial attention module to balance the importance of the time sequence and the local feature through a gating mechanism, solve the feature conflict problem caused by traditional splicing, and improve the robustness of the feature representation.

[0061] The spatial attention mechanism dynamically enhances the sensitive field feature through the spatial attention mechanism, and solves the problem of scattered key information in structured data.

[0062] First, channel compression and feature aggregation, average pooling and max pooling along the channel dimension: wherein, represents the output after average pooling, represents the output after max pooling operation, represents the average pooling operation, represents the max pooling operation.

[0063] For example, in the word government, the feature value of the character g position is [0.2, 0.8…], which becomes 0.5 after average pooling and 0.8 after max pooling.

[0064] Secondly, the results of the two are spliced to obtain an enhanced descriptor .

[0065] For the character g, the spliced feature vector becomes [0.5, 0.8].

[0066] wherein, the spatial dependency is learned through a spatial attention mechanism (SAM): wherein is an intermediate variable, representing the original output after spatial attention mechanism operation. In the spatial attention mechanism, a two-dimensional convolution kernel (kx, ky) is used ), fixed as single-channel output, step size is 1, and specific characters are used for edge padding to keep the convolution result consistent with the original size. The attention mask is generated after Sigmoid function activation: .

[0067] The attention weight is raised for the key character area, for example, in the word government, the gov part weight ≈ 0.9. The separator "," has a weight less than 0.1.

[0068] Feature weighting, multiply the input with the attention mask one by one, strengthen the key local features, get the spatial enhanced feature , wherein represents element-wise multiplication.

[0069] S24, concatenate the global dependent feature and the spatial enhanced feature along the feature dimension to obtain a fusion feature.

[0070] The spatial enhanced feature is concatenated with the global dependent feature along the feature dimension to obtain a fusion feature containing information of both .

[0071] S3, classification step: input the fusion feature into a classifier to obtain the sensitive data category of the structured data.

[0072] The classification includes the following two steps: First, global pooling compression ( ) is performed, and a feature vector with unchanged output dimension is output .

[0073] Second, output the probability distribution on a fully connected layer: Where N is the number of categories, indexed to a specific category by a specific natural number, for example, ID number = 0, phone number = 1, address = 2, etc.

[0074] Embodiment 2 Please refer to Figure 2 , which shows the structure of a structured sensitive data detection system with adaptive splicing scale proposed in the second embodiment of the application. The system includes the following key modules: A data preprocessing module 100 is used to obtain structured data, splice multiple fields in the structured data into a text sequence through a preset delimiter, and encode the text sequence into a character index sequence. The feature extraction and fusion module 200 is configured to input the character index sequence into an embedding layer to obtain a character embedding sequence, and input the character embedding sequence into a bidirectional long short-term memory network to extract a time sequence feature; a first feature processing path is established, the time sequence feature is input into a self-attention mechanism module, global dependency between characters in the text sequence is modeled to generate a global dependency feature; a second feature processing path parallel to the first feature processing path is established, the second feature processing path includes: performing feature extraction on the time sequence feature by using a multi-scale sliding window to obtain a multi-scale local feature; the time sequence feature and the multi-scale local feature are fused by a gating mechanism to generate an intermediate feature; the intermediate feature is input into a spatial attention module to perform feature weighting on the intermediate feature to obtain a spatial enhanced feature; and the global dependency feature and the spatial enhanced feature are spliced along a feature dimension to obtain a fusion feature. The classification module 300 is configured to input the fusion feature into a classifier to obtain a sensitive data category of the structured data.

[0075] The structured sensitive data detection system with adaptive concatenation scale in the embodiment of the application can be a device, a component, an integrated circuit or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), and the like, and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC) and the like, and the embodiment of the application is not limited in this regard.

[0076] The structured sensitive data detection system with adaptive concatenation scale in the embodiment of the application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system or other possible operating systems, and the embodiment of the application is not limited in this regard.

[0077] The structured sensitive data detection system with adaptive concatenation scale provided in the embodiment of the application can implement the method of the method embodiment. Figure 1 The processes implemented by the structured sensitive data detection method with adaptive concatenation scale in the method embodiment are not repeated here to avoid repetition.

[0078] Optionally, the embodiments of the present application further provide an electronic device, comprising a processor, a memory, a program or instructions stored in the memory and executable in the processor, which, when executed by the processor, implement each process of the above-mentioned method for detecting structured sensitive data with adaptive stitching scale and achieve the same technical effects. To avoid repetition, details are not described herein.

[0079] The embodiments of the present application further provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement each process of the above-mentioned method for detecting structured sensitive data with adaptive stitching scale and achieve the same technical effects. To avoid repetition, details are not described herein.

[0080] The processor is the processor of the electronic device in the above-mentioned embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.

[0081] It should be noted that, in this document, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that processes, methods, articles, or apparatuses that comprise a list of elements not only include those elements, but also include other elements not expressly listed or inherent to such processes, methods, articles, or apparatuses. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element. In addition, it should be pointed out that the scope of the methods and apparatuses in the embodiments of the present application is not limited to the order of performing functions as shown or discussed, but can also include performing functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from that described, and various steps can also be added, omitted, or combined. In addition, the features described with reference to certain examples can be combined in other examples.

[0082] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, also can be through hardware, but many cases the former is the better embodiment. Based on such understanding, the technical solutions of the present application essentially or say the part of the contribution to the prior art can be embodied in the form of software products, the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), including a number of instructions to make a terminal (may be a mobile phone, computer, server, air conditioner, or network equipment, etc.) executes the method described in various embodiments of the present application.

[0083] The embodiments of the present application are described above in conjunction with the drawings, but the present application is not limited to the above-mentioned specific embodiments, the above-mentioned specific embodiments are only illustrative, but not limited, those skilled in the art can make many forms without departing from the purpose of the present application and the scope of the claims under the inspiration of the present application, all belong to the protection of the present application.< / pad> < / unk> < / unk> < / pad> < / unk> < / pad> < / pad> < / unk> < / unk> < / pad>

Claims

1. A splicing scale-adaptive structured sensitive data detection method, characterized in that: The method comprises: S1. Data preprocessing step: obtaining structured data, concatenating multiple fields in the structured data into a text sequence using preset delimiters, and performing character set encoding on the text sequence to obtain a character index sequence; S2, feature extraction and fusion step: This step includes: Inputting the character index sequence into an embedding layer to obtain a character embedding sequence, and then inputting the character embedding sequence into a bidirectional long short-term memory network to extract a temporal feature; Establishing a first feature processing path, inputting the temporal features into a self-attention mechanism module, and generating a global dependency feature by modeling the global dependency relationship between characters in the text sequence; Establishing a second feature processing path in parallel with the first feature processing path, the path comprising: Extracting features from the time series features using a multi-scale sliding window to obtain a multi-scale local feature; fusing the temporal features with the multi-scale local features through a gating mechanism to generate an intermediate feature; Inputting the intermediate features into a spatial attention module, performing feature weighting on the intermediate features to obtain a spatial enhancement feature; Concatenate the global dependency feature and the spatial enhancement feature along the feature dimension to obtain a fusion feature; S3. Classification step: inputting the fusion features into a classifier to obtain the sensitive data category of the structured data.

2. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1, characterized in that: In the data preprocessing step, multiple fields in the structured data are spliced ​​into a text sequence using preset delimiters, specifically including: The length distribution of each field is statistically calculated based on the training data set, and a splicing scale threshold λ is preset; For the field to be processed, its length is determined. If the length of the field is greater than the threshold λ, the field is segmented according to the length of the threshold λ, and a preset special mark is added at the end of each truncated segment. If the length of the field is less than the threshold λ, the character sequence of the field is looped, and the character sequence obtained by the loop is padded to the end of the original field until the total length of the field reaches the threshold λ.

3. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1, characterized in that: In the first feature processing path, the processing process of the self-attention mechanism module specifically includes: The input time series features are linearly transformed by the first projection matrix, the second projection matrix, and the third projection matrix to generate a query vector Q, a key vector K, and a value vector V; An attention weight matrix is ​​calculated by performing matrix multiplication on the transpose of the query vector Q and the key vector K, and scaling and normalizing the result with a Softmax function; Perform matrix multiplication on the attention weight matrix and the value vector V to obtain the weighted aggregated global dependency feature.

4. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1, characterized in that: In the second feature processing path, a multi-scale sliding window is used to extract features from the time series features to obtain a multi-scale local feature, specifically including: Preset a sliding window scale set containing at least two different integers; For each scale s in the multi-scale sliding window scale set, s / 2 zero vectors are padded at both ends of the temporal dimension of the character embedding sequence to obtain a padded sequence; For each time step of the padded sequence, extract all feature vectors within a window with a width of s and centered at the time step, and calculate their weighted sum to obtain a single-scale sliding window feature at scale s; The single-scale sliding window features obtained at all scales are spliced ​​along the feature dimension, and then the dimension of the spliced ​​features is compressed to be consistent with the hidden layer dimension of the temporal feature through a linear transformation layer to obtain the multi-scale local features.

5. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1, characterized in that: In the second feature processing path, the temporal feature is fused with the multi-scale local feature through a gating mechanism to generate an intermediate feature, specifically including: The temporal features and the multi-scale local features are concatenated or element-wise operated, and the result is input into a linear layer, and then an interaction weight gate value is calculated through the Sigmoid activation function. ; Using the interaction weight gating value The time series features are weighted and the 1- The multi-scale local features are weighted, and two weighted results are added together to obtain the intermediate features.

6. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1 or 5, characterized in that: In the second feature processing path, the processing process of the spatial attention module specifically includes: Performing an average pooling operation and a maximum pooling operation along the channel dimension of the intermediate feature to obtain an average pooling feature descriptor and a maximum pooling feature descriptor; Concatenating the average pooled feature descriptor and the maximum pooled feature descriptor along the channel dimension to form an enhanced feature descriptor; Inputting the enhanced feature descriptor into a two-dimensional convolutional layer configured as a single output channel and using zero padding for convolution operation, and then processing the convolution result through a Sigmoid activation function to generate a spatial attention mask; The spatial attention mask is element-wise multiplied with the input intermediate feature to obtain the spatial enhanced feature.

7. The method for detecting structured sensitive data with adaptive splicing scale according to claim 1, characterized in that: In the data preprocessing step, character set encoding is performed on the text sequence to obtain a character index sequence, which specifically includes: Traverse the training data set, count all the characters that appear, and build a character-to-index mapping dictionary, using <pad>Indicates fill characters and <unk> Indicates unregistered characters;< / unk> < / pad> According to the mapping dictionary, each character in the text sequence is converted to its corresponding unique index. If the character is not in the dictionary, it is converted to <unk> The corresponding indexes form an initial index sequence;< / unk> Determine whether the length of the initial index sequence is less than a preset maximum sequence length, and if so, fill the end of the initial index sequence with the <pad> The corresponding index is calculated until the sequence length is equal to the maximum sequence length to obtain the character index sequence.< / pad> 8. A splicing scale adaptive structured sensitive data detection system, characterized by: The system comprises: A data preprocessing module is used to obtain structured data, splice multiple fields in the structured data into a text sequence through preset delimiters, and character set encode the text sequence to obtain a character index sequence; A feature extraction and fusion module is configured to input the character index sequence into an embedding layer to obtain a character embedding sequence, and then input the character embedding sequence into a bidirectional long short-term memory network to extract a temporal feature; establish a first feature processing path, input the temporal feature into a self-attention mechanism module, and generate a global dependency feature by modeling the global dependency relationship between characters in the text sequence; establish a second feature processing path in parallel with the first feature processing path, which path includes: extracting features from the temporal feature using a multi-scale sliding window to obtain a multi-scale local feature; fusing the temporal feature with the multi-scale local feature through a gating mechanism to generate an intermediate feature; inputting the intermediate feature into a spatial attention module, performing feature weighting on the intermediate feature to obtain a spatial enhancement feature; and concatenating the global dependency feature and the spatial enhancement feature along the feature dimension to obtain a fused feature; A classification module is used to input the fusion features into a classifier to obtain the sensitive data category of the structured data.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the method implements the steps of a splicing scale-adaptive structured sensitive data detection method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the splicing scale adaptive structured sensitive data detection method as described in any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Sensitive information detection method, device and equipment and readable storage medium

    CN116932757A

  • Sensitive personal information identification method based on multi-scale feature dynamic fusion

    CN118551048A

  • Sensitive information detection technology and system based on multi-mode and steganography detection

    CN120277678A

  • Multi-dimensional time sequence anomaly detection method based on graph attention network

    CN120508947A

  • KR20220050758A