Real-time data desensitization method and system based on context awareness
By using a context-aware real-time data masking method, field-level masking strategies are dynamically generated, solving the problems of insufficient flexibility and high latency in traditional data masking solutions, and achieving fine-grained access control and efficient data processing.
Patent Information
- Application Number
- CN202511178468.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-22
AI Technical Summary
In existing technologies, traditional data anonymization schemes are difficult to flexibly adapt to user roles, access environments, and data sensitivity levels, resulting in over-anonymization or under-anonymization, coarse-grained permissions, risks of unauthorized access, high processing latency, and limited data availability.
By employing a context-aware real-time data anonymization method, this approach uses a gateway to intercept requests, parse user roles and access environment characteristics, dynamically generate field-level anonymization strategies, and combine the Netty pipeline processing architecture and the Drools rule engine to achieve real-time sensitive field processing.
It achieves fine-grained access control, reduces the risk of unauthorized access, improves data availability and security, reduces processing latency, and ensures the timeliness and accuracy of data in high-concurrency scenarios.
Smart Images

Figure CN120750643A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a real-time data desensitization method and system based on context perception. Background Art
[0002] In the digital age, with the widespread adoption of cloud computing and big data technologies, sensitive data faces extremely severe security challenges in cross-system and cross-role access scenarios. Traditional data masking solutions often rely on static masking rules, pre-setting masking policies (such as fixed field replacement and global data masking) before data is used. This makes it difficult to flexibly adapt the masking logic to dynamic contextual factors such as user role, access environment, and data sensitivity level.
[0003] Disadvantages of existing technology: (1) Limited policy flexibility: Current desensitization strategies are mostly based on static rule systems, which are difficult to meet the dynamic permission requirements of multiple roles and scenarios in a complex and ever-changing business ecosystem. In actual business scenarios, there are significant differences in the access rights of users from different departments and different job levels to data, and static rules cannot dynamically adjust the degree of desensitization based on real-time changes in user roles and scenarios. This limitation can easily lead to the phenomenon of "over-desensitization". For example, users with higher permissions who should obtain detailed data to support decision-making are provided with data that has almost lost its decision-making value after deep desensitization, which has a negative impact on their work efficiency and decision-making quality; conversely, "under-desensitization" may also occur, causing users with lower permissions to accidentally access sensitive information, posing potential risks to data security.
[0004] (2) Performance bottleneck: Traditional gateway architecture mainly adopts a serial processing mechanism. During the real-time desensitization process, data needs to pass through multiple processing links in sequence. This model easily leads to lengthy processing links, which in turn causes high latency issues. Taking high-concurrency real-time transaction data processing as an example, the latency of traditional gateway architecture can reach tens or even hundreds of milliseconds, which is far from the current stringent requirement of millisecond-level response, and seriously restricts the real-time interactive performance of the system.
[0005] (3) Coarse permission granularity: The role-based permission control model is relatively broad, assigning permissions based solely on the user's role and making it difficult to dynamically adjust permissions based on the access environment. In actual applications, IP whitelists can accurately limit access sources, and time period restrictions can effectively control the operation time range, but traditional permission control makes it difficult to take these environmental factors into account and implement dynamic corrections. When internal personnel have excessive role permissions and the access environment lacks effective restrictions, there is a high risk of overstepping permissions, which can easily lead to sensitive data leakage.
[0006] (4) Limited data availability: Traditional desensitization strategies often adopt a "unified" approach, applying the same desensitization rules to data in all scenarios. However, different business scenarios have significantly different data requirements. In a test environment, to ensure the accuracy and effectiveness of system debugging, it is often necessary to retain some real data to simulate real business processes. However, a unified desensitization strategy will over-process this data, causing it to lose its business value and fail to provide sufficient support for testing work.
[0007] Therefore, how to improve the shortcomings of the existing technology is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0008] To achieve the purpose of the present invention, the present application provides a real-time data desensitization method based on context awareness, comprising: Step S1: intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Step S2: parsing user role information based on the user authentication token, extracting access environment features based on the IP address and timestamp, and identifying and grading sensitive fields of the request body data to determine the data sensitivity level; Step S3: Based on the user role information, access environment characteristics and data sensitivity level, a predefined desensitization policy template is matched by a rule engine to generate a real-time desensitization policy including field-level desensitization instructions; Step S4: Verifying access rights based on the user authentication token and dynamically adjusting the desensitization intensity based on the access environment characteristics; Step S5: Perform real-time desensitization processing on the sensitive fields in the corresponding data according to the real-time desensitization strategy and desensitization intensity.
[0009] In some specific embodiments, step S6 is further included: Record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
[0010] In some specific embodiments, in step S2, the sensitive field identification and classification includes: Use natural language processing models to perform semantic analysis on request body data to identify sensitive fields containing personal identification information, financial data, or medical records; According to the preset sensitivity standards, the identified sensitive fields are marked as five levels from L1 to L5, where L1 to L5 represent the highest sensitivity level to the lowest sensitivity level.
[0011] In some specific embodiments, in step S3, the rule engine is implemented using Drools, and the matching logic of the rule engine includes: When the user role is a common user and the data sensitivity level is ≥ L3, a complete replacement desensitization method is used; When the user role is administrator and the access environment is intranet, a partially hidden desensitizing method is used.
[0012] In some specific embodiments, step S3 further includes: Continuously monitor the data access environment and immediately initiate an automated response process when anomalies that violate risk rules are detected, reducing the level of access permissions and increasing redaction efforts. In some specific embodiments, the abnormal situations that violate risk rules include accessing highly sensitive data through public IP, sudden changes in user roles, abnormal access time, abnormal equipment, abnormal access frequency, abnormal geographical location, abnormal operating behavior, abnormal environmental parameters, and abnormal audit logs.
[0013] In some specific embodiments, in step S3, the desensitizing instruction includes field replacement, data truncation, and mask display.
[0014] In some specific embodiments, in step S5, the real-time desensitization process includes: Identify data formats and perform different processing based on different data formats, including: If the data is in JSON format, mask or replace the sensitive fields in the JSON format data; If the data is in XML format, the sensitive nodes in the XML format data are truncated; If the data is in CSV format, format-preserving encryption is performed on sensitive columns in the CSV format data.
[0015] To achieve the same invention purpose, the present application also provides a real-time data desensitization system based on context awareness, comprising: Request interception module: used to intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Context parsing module: used to parse user role information based on the user authentication token, extract access environment features based on the IP address and timestamp, and identify and classify sensitive fields of the request body data to determine the data sensitivity level; Dynamic desensitization engine module: used to generate a real-time desensitization policy containing field-level desensitization instructions by matching predefined desensitization policy templates through a rule engine according to the user role information, access environment characteristics and data sensitivity level; Permission verification module: used to verify access rights based on the user authentication token and dynamically adjust the desensitization intensity based on the access environment characteristics; Desensitization execution module: used to perform real-time desensitization processing on sensitive fields in the corresponding data according to the real-time desensitization strategy and desensitization intensity.
[0016] In some specific embodiments, a logging module is also included: Used to record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
[0017] Beneficial effects of the above technical solution: (1) Performance Optimization: The real-time data desensitization gateway adopts an advanced pipeline processing architecture. The processing flow is request interception, parsing, policy generation, desensitization, and response. Combined with Netty non-blocking IO technology, the gateway achieves a significant breakthrough in performance.
[0018] (2) Balancing Data Availability and Security: To achieve an effective balance between data availability and security, the gateway uses a dynamic mapping mechanism between sensitivity levels and permissions. In a test environment, this mechanism enables relevant personnel to access 30%-70% of real data, reversing the situation where traditional solutions only provide 0% or 100% real data. This innovative approach not only meets compliance requirements but also enhances the value of data in testing scenarios, providing strong support for business development and compliance operations.
[0019] (3) Fine-grained permission control: The gateway has powerful fine-grained permission control capabilities and supports field-level permission management. In actual business scenarios, role A can be flexibly configured to view the order amount field, while role B can only view the result after the amount is masked. Compared with traditional RBAC solutions, the permission granularity in this application's solution is refined to the field level. After evaluation, the risk of unauthorized access is reduced by more than 90%, effectively ensuring the security and compliance of data access. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A flowchart of a real-time data desensitization method based on context awareness provided by one embodiment of the present invention; Figure 2 A schematic structural diagram of a real-time data desensitization system based on context awareness is provided for one embodiment of the present invention. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0023] Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar symbols throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0024] Example 1 The implementation of the present invention adopts a microservice technology architecture, using the SpringCloud service framework as the basic platform framework for the real-time data desensitization gateway effect based on context awareness. The present invention adopts a distributed system architecture, supports horizontal expansion based on any scale of data nodes, and improves the computing processing capacity of the entire cluster. An embodiment of the present invention provides a real-time data desensitization method based on context awareness, referring to Figure 1 As shown, including: Step S1: intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Utilizing Netty, a high-performance asynchronous event-driven network application framework, and relying on Spring Cloud Gateway, an API gateway solution based on the Spring ecosystem, the system achieves real-time and precise interception of HTTP / HTTPS traffic. During interception, it can deeply parse and extract key information from request headers, such as user authentication tokens and request sources; accurately obtain URL parameters, including query conditions and path variables; and comprehensively parse payload data, including JSON-formatted request bodies and form data, laying a complete and accurate data foundation for subsequent data masking processes. Utilizing connection pooling technology, the system efficiently manages and reuses network connection resources, significantly reducing the overhead associated with connection creation and destruction. Combined with asynchronous processing mechanisms such as the Netty event loop, the system can process large numbers of requests in parallel, significantly improving system throughput. This architectural design ensures efficient execution of data masking operations, ensuring timely and accurate data masking even in highly concurrent scenarios.
[0025] The system is equipped with a high-precision request interception mechanism that can accurately intercept all incoming requests and immediately initiate a comprehensive and detailed parsing process. During the parsing process, the system uses advanced token parsing technology to conduct in-depth analysis of the token carried by the request and accurately extract user role information. At the same time, the system can automatically and efficiently collect a variety of environmental parameters, including multi-dimensional information such as the IP address of the request source, device type, operating system version, and network access method. Subsequently, based on pre-established and fully verified data sensitivity classification rules, the system uses complex algorithm models to conduct a comprehensive assessment of the data involved in the request, achieve accurate sensitivity classification, and provide a solid and reliable foundation for subsequent processing steps.
[0026] Step S2: parsing user role information based on the user authentication token, extracting access environment features based on the IP address and timestamp in the request header, and identifying and grading sensitive fields of the request body data to determine the data sensitivity level; In a specific embodiment of the present invention, in step S2, the sensitive field identification and classification includes: Use natural language processing models to perform semantic analysis on request body data to identify sensitive fields containing personal identification information, financial data, or medical records; According to the preset sensitivity standards, the identified sensitive fields are marked as five levels from L1 to L5, where L1 to L5 represent the highest sensitivity level to the lowest sensitivity level.
[0027] Specifically, the system relies on advanced token parsing technology to accurately extract user IDs from JWT / OAuth2 tokens. This process utilizes complex encryption algorithms and decoding logic to ensure a high degree of accuracy and security in data extraction. Simultaneously, the system conducts in-depth role group identification. For example, "ROLE_DOCTOR" represents the doctor role, which is granted specific data access permissions primarily for the review and processing of medical diagnostic data; "ROLE_AUDITOR" represents the auditor role, whose permissions focus on compliance reviews of various data operations. Through this meticulous role division, the system lays a solid foundation for subsequent data access control.
[0028] In the environmental feature extraction phase, the system first analyzes the client IP address and obtains the network location information of the client device through network protocol analysis. This helps to accurately identify the source of data requests and effectively identify abnormal network access behavior. The system accurately records the request timestamp and uses high-precision time synchronization technology to ensure the accuracy of time records, so as to conduct subsequent time series-based data analysis, such as counting the frequency of data requests within a specific time period. In addition, the system deeply extracts device fingerprints. Taking User-Agent as an example, the system constructs a unique identifier for the device by parsing the information contained therein, such as the operating system, browser type and version, providing comprehensive environmental information support for each data request.
[0029] To achieve accurate data sensitivity classification, the system uses advanced NLP algorithms, such as the BERT model. The BERT model is pre-trained based on a large-scale corpus and has the ability to deeply understand the semantics of text. In the process of identifying sensitive data fields, the model analyzes the request data word by word and uses a complex neural network structure to accurately identify sensitive information such as ID card numbers and bank card numbers. After identification, the system labels the data sensitivity based on preset sensitivity level labels (L1-L5). Level L1 represents the highest sensitivity, such as critical privacy information in personal medical records; Level L5 represents a relatively low sensitivity, such as general user preference data. Through this scientific classification method, the system can implement corresponding desensitization strategies for data of different sensitivity levels.
[0030] Step S3: Based on the user role information, access environment characteristics and data sensitivity level, a rule engine is used to match a predefined desensitization policy template to generate a real-time policy containing field-level desensitization instructions; In a specific embodiment of the present invention, in step S3, the rule engine is implemented using Drools, and the matching logic of the rule engine includes: When the user role is a common user and the data sensitivity level is ≥ L3, a complete replacement desensitization method is used; When the user role is administrator and the access environment is intranet, a partially hidden desensitizing method is used; When abnormal access behavior is detected, the desensitization intensity is automatically increased.
[0031] In a specific embodiment of the present invention, step S3 further includes: Continuously monitor the data access environment and immediately initiate an automated response process when anomalies that violate risk rules are detected, reducing the level of access permissions and increasing redaction efforts. In a specific embodiment of the present invention, the abnormal situations that violate risk rules include accessing highly sensitive data through a public IP, whether the user role changes suddenly, whether the access time is outside regular working hours, whether the device is an unfamiliar device, whether the access frequency is abnormally frequent, whether the authority is temporarily upgraded but not applied for according to the process, whether the geographical location changes suddenly, whether the operation behavior is abnormal, whether environmental parameters such as IP change frequently, whether there are conflicts in policy execution, whether there are abnormal records in the audit log, etc.
[0032] In a specific embodiment of the present invention, in step S3, the desensitization instruction includes field replacement, data truncation, and mask display.
[0033] Specifically, powerful rule engine tools such as Drools are integrated to build a flexible and efficient rule matching mechanism. Its operating logic is based on contextual parameters, that is, a comprehensive consideration of user roles (such as ordinary users, administrators, data analysts, etc.), operating environments (production environments, test environments, development environments, etc.) and sensitivity levels (high sensitivity, medium sensitivity, low sensitivity). Through the precise identification and analysis of these key contextual parameters, the system can dynamically match pre-set desensitization policy templates. For example, in a production environment, for highly sensitive data, if the user role is an ordinary user, a "complete replacement" desensitization policy may be triggered; in a test environment, for highly sensitive data, if the user role is a data analyst, a "partial hiding" desensitization policy may be adopted. Example rules are as follows: when / / Conditional judgment: The user role is nurse, the current environment IP is not in the 192.168 network segment, and the data sensitivity level is 3 User(role=="ROLE_NURSE")&&Environment(ipnotin"192.168.%.%")&&Data(sensitivityLevel==3) then / / Perform desensitization operation: Perform field replacement on the phone field and replace it with ****#### insert("Desensitization Strategy","Field Replacement","phone","****####"); This mechanism enables the system to rapidly load various policies during operation. Leveraging the Drools rules engine, the system can dynamically analyze complex conditional expressions in real time, precisely adapting to the business needs of diverse scenarios. Whether faced with sudden business adjustments or evolving security policy requirements, this mechanism flexibly responds, enabling dynamic changes to system configurations and meeting flexible configuration requirements in diverse scenarios.
[0034] Specifically, based on the matching results of the above conditions, real-time desensitization instructions are intelligently generated. These instructions include: partial field replacement, which replaces sensitive fields with specific character combinations according to pre-set rules; data truncation, which intercepts data of a certain length based on actual needs to conceal sensitive portions; and masked display, which uses masking symbols to cover the display of sensitive information. Furthermore, the policy generator is highly flexible, supporting complex pattern matching through regular expressions and dynamic replacement using template variables. It can dynamically adjust desensitization rules based on different scenarios and data characteristics, ensuring that desensitization operations can accurately adapt to diverse data needs.
[0035] The system accurately verifies the user's access rights to target resources based on the scope declared in the JWT / OAuth2 token. For example, if the permission is "read:patient:low," the user is only authorized to read low-level patient information, specifically basic patient attributes, including but not limited to general data such as name and age. If the permission is "write:finance:high," the user is granted write access to high-level financial data, allowing them to modify and update key financial data.
[0036] The system continuously monitors the data access environment and immediately initiates an automated response process when it detects anomalies that violate risk rules, such as access to highly sensitive data via a public IP address. This process automatically downgrades access permissions, for example, reducing the level of access from a high-level user with full access to sensitive information to a low-level user with limited access to critical information. Simultaneously, it strengthens redaction efforts, such as upgrading sensitive data from partially obfuscated characters to fully replacing or deeply encrypting key content, ensuring data security in high-risk environments.
[0037] The rule engine is quickly loaded after receiving the context parameters obtained above. These context parameters cover key elements such as user roles, environmental information, and data sensitivity levels. Relying on a powerful matching algorithm, the rule engine performs efficient matching in a huge policy template library, and accurately determines the policy template that is most suitable for the current request from a large number of templates. Based on the selected template, the system uses intelligent generation technology to generate a detailed and comprehensive desensitization instruction set. The instruction set is highly flexible and supports prioritization of multiple desensitization strategies. It can reasonably arrange the execution order of various desensitization strategies according to the needs of different scenarios. At the same time, the instruction set has a built-in advanced conflict resolution mechanism. When multiple desensitization strategies conflict during execution, it can quickly identify and take effective measures to resolve them, ensuring that the strategies can still be effectively executed in complex and changing scenarios.
[0038] Step S4: Verifying access rights based on the user authentication token and dynamically adjusting the desensitization intensity based on the access environment characteristics; Specifically, as a key component of the data desensitization gateway, this module is responsible for real-time processing of response data. Given the diverse data format requirements, it possesses the ability to accurately parse common data formats such as JSON, XML, and CSV. Advanced byte stream modification technology is employed in the desensitization process. This technology offers the significant advantage of achieving non-invasive desensitization, effectively processing sensitive data without interfering with the existing business system architecture or data transmission process, thereby ensuring the security and integrity of data during transmission.
[0039] Step S5: Perform real-time desensitization processing on the sensitive fields in the response data according to the generated real-time desensitization strategy and desensitization intensity.
[0040] In a specific embodiment of the present invention, in step S5, the real-time desensitization process includes: Identify data formats and perform different processing based on different data formats, including: If the data is in JSON format, mask or replace the sensitive fields in the JSON format data; If the data is in XML format, the sensitive nodes in the XML format data are truncated; If the data is in CSV format, format-preserving encryption is performed on sensitive columns in the CSV format data.
[0041] Specifically, through rigorous logical design, the system establishes a strict positive correlation between permission levels and desensitization efforts. In actual scenarios, users with permission level L4, because of their higher permissions in the system, can obtain 30% of the plaintext content of L2 sensitive data through precise calculation and control by the system. This part of the plaintext content can not only meet the necessary information needs in their work, but also avoid security risks caused by excessive data exposure. Users with permission level L2 only have relatively low permissions. Based on security and rational considerations, the system only allows them to obtain 10% of the plaintext of L2 sensitive data, thereby ensuring that data access maintains a balance between security and rationality at all permission levels.
[0042] In a specific embodiment of the present invention, step S6 is further included: Record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
[0043] Specifically, it thoroughly records the contextual parameters involved in each desensitization operation, including user information, environmental parameters, and data characteristics. It also accurately records the applied policy version information to ensure traceability of policy changes. Furthermore, it fully preserves the data modification trajectory, detailing every step of the data's evolution from its original state to its desensitized state. This functional module serves as a key optional entry point for system expansion, providing detailed data support for subsequent security audits, facilitating the rapid identification and tracing of root causes of issues, and effectively improving system security and maintainability.
[0044] Example 2 An embodiment of the present invention provides a real-time data desensitization system based on context awareness, referring to Figure 2 As shown, including: Request interception module 10: used to intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Context parsing module 20: used to parse user role information based on the user authentication token, extract access environment features based on the IP address and timestamp in the request header, and identify and classify sensitive fields in the request body data to determine the data sensitivity level; In a specific embodiment of the present invention, in the context parsing module 20, the sensitive field identification and classification includes: Use natural language processing models to perform semantic analysis on request body data to identify sensitive fields containing personal identification information, financial data, or medical records; According to the preset sensitivity standards, the identified sensitive fields are marked as five levels from L1 to L5, where L1 to L5 represent the highest sensitivity level to the lowest sensitivity level.
[0045] Dynamic desensitization engine module 30: used to generate a real-time desensitization policy including field-level desensitization instructions by matching a predefined desensitization policy template through a rule engine according to the user role information, access environment characteristics and data sensitivity level; In a specific embodiment of the present invention, in the dynamic desensitization engine module 30, the rule engine is implemented using Drools, and the matching logic of the rule engine includes: When the user role is a common user and the data sensitivity level is ≥ L3, a complete replacement desensitization method is used; When the user role is administrator and the access environment is intranet, a partially hidden desensitizing method is used; When abnormal access behavior is detected, the desensitization intensity is automatically increased.
[0046] The permission verification module 40 is used to verify the access rights based on the user authentication token and dynamically adjust the desensitization strength based on the access environment characteristics; The desensitization execution module 50 is used to perform real-time desensitization processing on the sensitive fields in the corresponding data according to the real-time desensitization strategy and desensitization intensity.
[0047] In a specific embodiment of the present invention, in the desensitization execution module, the real-time desensitization processing includes: Identify data formats and perform different processing based on different data formats, including: If the data is in JSON format, mask or replace the sensitive fields in the JSON format data; If the data is in XML format, the sensitive nodes in the XML format data are truncated; If the data is in CSV format, format-preserving encryption is performed on sensitive columns in the CSV format data.
[0048] In a specific embodiment of the present invention, a logging module is also included: Used to record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
[0049] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
[0050] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the functions in the process. Figure 1 a process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more blocks. Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention. Finally, it should be noted that, in this document, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or terminal device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.
[0051] The method and apparatus provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
[0052] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "example," "specific example," "a specific embodiment," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A real-time data desensitization method based on context awareness, characterized in that: include: Step S1: intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Step S2: parsing user role information based on the user authentication token, extracting access environment features based on the IP address and timestamp, and identifying and grading sensitive fields of the request body data to determine the data sensitivity level; Step S3: Based on the user role information, access environment characteristics and data sensitivity level, a predefined desensitization policy template is matched by a rule engine to generate a real-time desensitization policy including field-level desensitization instructions; Step S4: Verifying access rights based on the user authentication token and dynamically adjusting the desensitization intensity based on the access environment characteristics; Step S5: Perform real-time desensitization processing on the sensitive fields in the corresponding data according to the real-time desensitization strategy and desensitization intensity.
2. The context-aware real-time data desensitization method according to claim 1, characterized in that: The step S6 is also included: Record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
3. The context-aware real-time data desensitization method according to claim 1, characterized in that: In step S2, the sensitive field identification and classification includes: Use natural language processing models to perform semantic analysis on request body data to identify sensitive fields containing personal identification information, financial data, or medical records; According to the preset sensitivity standards, the identified sensitive fields are marked as five levels from L1 to L5, where L1 to L5 represent the highest sensitivity level to the lowest sensitivity level.
4. The context-aware real-time data desensitization method according to claim 3, characterized in that: In step S3, the rule engine is implemented using Drools, and the matching logic of the rule engine includes: When the user role is a common user and the data sensitivity level is ≥ L3, a complete replacement desensitization method is used; When the user role is administrator and the access environment is intranet, a partially hidden desensitizing method is used.
5. The context-aware real-time data desensitization method according to claim 1, characterized in that: Step S3 further includes: Continuously monitor the data access environment and immediately initiate automated response processes when anomalies that violate risk rules are detected, reducing access rights and increasing redaction efforts.
6. The context-aware real-time data desensitization method according to claim 5, characterized in that: The abnormal situations that violate risk rules include accessing highly sensitive data through public IP, sudden changes in user roles, abnormal access time, abnormal equipment, abnormal access frequency, abnormal geographical location, abnormal operating behavior, abnormal environmental parameters, and abnormal audit logs.
7. The context-aware real-time data desensitization method according to claim 1, characterized in that: In step S3, the desensitization instructions include field replacement, data truncation, and mask display.
8. The context-aware real-time data desensitization method according to claim 1, characterized in that: In step S5, the real-time desensitization process includes: Identify data formats and perform different processing based on different data formats, including: If the data is in JSON format, mask or replace the sensitive fields in the JSON format data; If the data is in XML format, the sensitive nodes in the XML format data are truncated; If the data is in CSV format, format-preserving encryption is performed on sensitive columns in the CSV format data.
9. A real-time data desensitization system based on context awareness, characterized in that: include: Request interception module: used to intercept HTTP / HTTPS requests through the gateway and extract the user authentication token, URL parameters, IP address, timestamp and request body data in the request header; Context parsing module: used to parse user role information based on the user authentication token, extract access environment features based on the IP address and timestamp, and identify and classify sensitive fields of the request body data to determine the data sensitivity level; Dynamic desensitization engine module: used to generate a real-time desensitization policy containing field-level desensitization instructions by matching predefined desensitization policy templates through a rule engine according to the user role information, access environment characteristics and data sensitivity level; Permission verification module: used to verify access rights based on the user authentication token and dynamically adjust the desensitization intensity based on the access environment characteristics; Desensitization execution module: used to perform real-time desensitization processing on sensitive fields in the corresponding data according to the real-time desensitization strategy and desensitization intensity.
10. The real-time data desensitization system based on context awareness according to claim 9 is characterized in that: Also includes logging modules: Used to record the operation logs of steps S1-S5, including the context parameters involved in each desensitization operation, including user information, environment parameters and data characteristics, and record the application policy version information and data modification trajectory.
Citation Information
Patent Citations
Dynamic data desensitization method and system
CN119885259A
Hospital database management method and system based on adaptive data desensitization
CN120030601A
Data desensitization control method and control system
CN120277720A
Method and platform for integrating and sharing health data of old people
CN120321057A
Data transmission method and device
WO2025107944A1
Cited By
Large model gateway security protection system and security protection method
CN120951390A
Industrial data desensitization method, system and equipment and medium
CN121859362A
A dynamic data desensitization method and desensitization system
CN122490574A