Dynamic data desensitization method and system for realizing zero intrusion
By employing a zero-intrusion dynamic data masking method, utilizing server-side automatic update rules and atomic references, combined with five-dimensional feature extraction and a dual-mode adaptive mechanism, the invasiveness and performance issues of existing data masking solutions are resolved. This achieves efficient and flexible data masking, meeting the masking needs of enterprises in compliance requirements and high-concurrency scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-04-10
AI Technical Summary
Existing data masking solutions suffer from problems such as high intrusiveness, poor compatibility, significant performance loss, and insufficient rule dynamism, making it difficult to meet the masking needs of enterprises in compliance requirements, business iterations, and high-concurrency scenarios.
This paper presents a zero-intrusion dynamic data anonymization method. It automatically updates rules by listening to configuration information on the server side, dynamically switches the rule engine using atomic references, performs anonymization during data serialization, and combines five-dimensional feature extraction and a dual-mode adaptive mechanism to achieve efficient and flexible data anonymization.
It achieves zero-intrusion rule updates, improves the real-time response capability of the server and the de-identification efficiency in high-concurrency scenarios, balances performance and resource optimization, and ensures user experience and server stability.
Smart Images

Figure CN121834873A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and system for achieving zero-intrusion dynamic data desensitization. Background Technology
[0002] In common software, two common approaches are used to achieve data anonymization: annotation-driven approach and AOP aspect-based approach.
[0003] Annotation-driven solutions rely on adding custom annotations to fields in the data model to mark fields that need to be anonymized, which is intrusive to the code. When a large amount of legacy code or classes from third-party libraries need to be anonymized, it is impossible to modify their source code to add annotations. In addition, if the anonymization strategy needs to be adjusted, the application needs to be recompiled and deployed.
[0004] AOP aspect-based solutions modify field values via reflection, which incurs significant performance overhead. They are also complex for handling nested objects or collections, and rely on annotations or configuration rules, making dynamic rule updates difficult.
[0005] In summary, both existing data masking solutions suffer from insurmountable technical bottlenecks: annotation-driven solutions are highly invasive and have poor compatibility; AOP aspect-based solutions suffer from significant performance overhead and insufficient rule dynamism. Furthermore, both share common problems such as insufficient dynamism, poor cross-scenario compatibility, and difficulty in balancing performance and resources, rendering existing solutions unable to meet enterprises' masking needs under compliance requirements, business iterations, and high-concurrency scenarios. Summary of the Invention
[0006] The technical problem to be solved by the present invention is: to provide a method and system for achieving zero-intrusion dynamic data desensitization, thereby achieving zero-intrusion, efficient and flexible data desensitization.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for achieving zero-intrusion dynamic data desensitization, comprising: The server obtains and loads the de-identification rules from the configuration source, parses the de-identification rules into rule objects in memory, and builds the original dynamic rule engine based on the rule objects. At the same time, it listens for the configuration information of the configuration source. When the configuration information changes, it automatically triggers the update program, reloads and parses the de-identification rules corresponding to the changed configuration information to update the rule objects, obtains the updated rule objects, and builds the current dynamic rule engine based on the updated rule objects. The system receives a business request from the client, dynamically switches between the original dynamic rule engine and the current dynamic rule engine using atomic references based on the business request, matches the original data of the business request with the corresponding rule object to obtain a matched rule object, and desensitizes the original data based on the matched rule object during the serialization process of the original data to obtain desensitized data, and returns the desensitized data to the client.
[0008] The beneficial effects of this invention are as follows: It monitors the configuration information of the configuration source, and when the configuration information changes, it automatically triggers an update program to update the rule objects in memory. This achieves automatic updates to the de-identification rules without restarting the service or modifying the code, resulting in zero intrusion and improved real-time server responsiveness. It dynamically switches between the original dynamic rule engine and the current dynamic rule engine using atomic references. The entire switching process ensures thread safety through atomic operations, achieving zero-aware switching and enabling rapid and efficient adaptation to de-identification needs in business iterations and high-concurrency scenarios. Furthermore, it de-identifies the original data during the serialization process, i.e., de-identification occurs just before the original data is output, eliminating the need for additional traversal or copying of the original data, thus balancing performance and resource optimization.
[0009] Optionally, the step of dynamically switching between the original dynamic rule engine and the current dynamic rule engine using atomic references based on the business request, so as to match the original data of the business request with the corresponding rule object, includes: Determine whether the business request has entered the processing stage. If so, obtain the original data of the business request and route the business request to the original dynamic rule engine using atomic references. Then, match the original data with the rule object corresponding to the original dynamic rule engine through the original dynamic rule engine. If not, then generate the original data corresponding to the business request, route the business request to the current dynamic rule engine using atomic references, and match the original data with the rule object corresponding to the current dynamic rule engine through the current dynamic rule engine.
[0010] Optionally, the processing stage includes a processing stage and a desensitization stage.
[0011] As described above, by first determining whether a business request has entered the processing stage, the two types of business requests are accurately distinguished. For business requests that have entered the processing stage, they are routed to the original dynamic rule engine, taking into account both the processing stage and the stage to be de-identified. This ensures that the business request uses only the same set of rule objects throughout its entire lifecycle, avoiding de-identification anomalies caused by switching rule objects midway. For business requests that have not entered the processing stage, they are directly routed to the current dynamic rule engine, ensuring that the updated rule objects take effect immediately, balancing the user experience of the client and the stability of the server.
[0012] Optionally, the step of matching the original data of the business request with the corresponding rule object to obtain the matched rule object includes: The data class name, data field name, and data JSON path of the original data are matched with the object class name, object field name, and object JSON path of the corresponding rule object to obtain all candidate rule objects; Five-dimensional feature extraction is performed on each candidate rule object by a feature extractor to obtain the five-dimensional feature of each candidate rule object. The priority weight of each candidate rule object is obtained based on the five-dimensional feature of each candidate rule object. The candidate rule object with the highest priority weight is selected as the matched rule object from all the priority weights of the candidate rule objects. The five-dimensional features are: path features, field features, class matching features, condition features, and rule features.
[0013] As described above, candidate rule objects are initially selected based on three dimensions: data class name, numeric fields, and data JSON path. Rule objects completely unrelated to the original data structure are directly excluded, avoiding resource waste caused by ineffective computation. For each candidate rule object, five-dimensional feature extraction is performed, including path features, field features, class matching features, condition features, and rule features. This converts the match into quantifiable feature values, addressing the pain points of traditional fuzzy matching judgments. The candidate rule object corresponding to the highest priority weight is then selected as the matched rule object, improving the accuracy of the obtained matched rule objects.
[0014] Optionally, the step of extracting five-dimensional features from each candidate rule object using a feature extractor to obtain five-dimensional features for each candidate rule object, obtaining the priority weight of each candidate rule object based on its five-dimensional features, and selecting the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object includes: Calculate the path depth, number of operators, and number of function calls in the JSON path of each candidate rule object. Input the path depth, number of operators, and number of function calls into the first feature formula for calculation to obtain the path feature of each candidate rule object. The first feature formula is: ; in, Indicate path features, Indicates path weight, Indicates operator weight, express Weight; Calculate the first overlap between the object field name and the data field name of the original data in each candidate rule object, and simultaneously obtain the field matching pattern between the object field name and the numeric field name. Input the first overlap and the field matching pattern into a second feature formula for calculation to obtain the field features of each candidate rule object. The second feature formula is: ; in, Indicates field characteristics, Indicates the first overlapping weight. Indicates the field matching weight; Calculate the second overlap degree between the class package path depth corresponding to the object class name in each candidate rule object and the class package path depth corresponding to the data class name in the original data. Simultaneously, obtain the class matching pattern between the object class name and the data class name. Input the second overlap degree and the class matching pattern into a third feature formula for calculation to obtain the class feature of each candidate rule object. The third feature formula is: ; in, Representing class features, Indicates the second overlapping weight. Indicates class matching weight; Obtain the matching conditions for each candidate rule object, calculate the number of operators and variable references for the matching conditions, and match the matching conditions with the field values of the original data to generate matching results; The matching result, the number of operators, and the number of variable references are input into the fourth feature formula for calculation to obtain the conditional features of each candidate rule object. The fourth feature formula is: ; in, Indicates conditional features, Indicates the matching weight. express Weight, express Weight; Obtain the desensitization strategy and the domain of the original data for each candidate rule object. Input the desensitization strategy and the domain into the fifth feature formula for calculation to obtain the rule feature of each candidate rule object. The fifth feature formula is: ; in, Representing rule features, Indicates the strategy weights. Represents the domain weight; The path features, field features, class matching features, condition features, and rule features of each candidate rule object are input into the first weight formula for calculation, resulting in the priority weight of each candidate rule object. The first weight formula is as follows: ; in, This represents the priority weight of candidate rule object i. Indicate path features, Indicates field characteristics, Representing class features, Indicates conditional features, Representing rule features, Indicates path weight, Indicates field weight. Indicates class weight, Indicates conditional weights, Indicates the rule weight; Select the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object.
[0015] As described above, it is known that not only are each feature in the five-dimensional feature calculated in fine granularity, but the domain of the original data is also taken into account, achieving domain-specific adaptation and improving flexibility.
[0016] Optionally, the step of selecting the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object includes: Determine whether the number of matched rule objects is greater than 1. If so, sort the matched rule objects in descending order according to their priority weights to obtain a descending sorted sequence. Calculate the weight difference between the priority weight of the first matched rule object and the priority weight of the second matched rule object in the descending sort sequence. Determine whether the weight difference is greater than the weight threshold. If so, take the first matched rule object in the descending sort sequence as the final matched rule object. If not, trigger a multi-level arbitration mechanism to determine whether the update time of the first matched rule object in the descending sort sequence is the same as the update time of the second matched rule object. If they are the same, determine whether the rule ID of the first matched rule object in the descending sort sequence is less than the rule ID of the second matched rule object. If yes, take the first matched rule object in the descending sort sequence as the final matched rule object. If no, take the second matched rule object in the descending sort sequence as the final matched rule object. If they are not the same, determine whether the update time of the first matched rule object in the descending sorted sequence is later than the update time of the second matched rule object. If yes, the first matched rule object in the descending sorted sequence is taken as the final matched rule object. If no, the second matched rule object in the descending sorted sequence is taken as the final matched rule object.
[0017] As described above, when multiple matched rule objects exist, the difference between the top two weights of the matched rule objects sorted in descending order of priority weight is compared with a weight threshold. If the weight difference is not greater than the weight threshold, a multi-level arbitration mechanism is triggered to filter the final matched rule objects based on the update time and rule ID. This not only avoids mis-filtering of matched rule objects due to small weight differences, but also resolves conflicts when priority weights are the same, thus improving the accuracy of the final matched rule objects obtained.
[0018] Optionally, the weight threshold includes a dynamic weight threshold. When the weight threshold is a dynamic weight threshold, determining whether the weight difference is greater than the weight threshold includes: Obtain the current CPU idle rate, current used heap memory, maximum heap memory, current load, and number of CPU cores of the server. At the same time, obtain the scaling baseline of the server in a healthy state and the maximum scaling ratio in a dangerous state. The current CPU idle rate is input into the first pressure formula for calculation to obtain the CPU pressure score. The first pressure formula is: ; The currently used heap memory and the maximum heap memory are input into the second pressure formula to calculate the memory pressure score. The second pressure formula is as follows: ; The current load and the number of CPU cores are input into the third stress formula to calculate the load stress score. The third stress formula is as follows: ; The CPU stress score, memory stress score, and load stress score are input into a first health formula for calculation to obtain the health score. The first health formula is: ; in, Indicates CPU weight. express , express ; The health score, the scaling baseline, and the maximum scaling ratio are input into a second health formula to calculate the health coefficient. The health formula is as follows: ; in, Indicates the nonlinear coefficient; The health coefficient is input into a first dynamic formula for calculation to obtain a dynamic weight threshold. It is then determined whether the weight difference is greater than the dynamic weight threshold. The first dynamic formula is: ; in, This represents the base threshold.
[0019] As described above, the use of dynamic weight thresholds solves the problem of insufficient matching accuracy caused by traditional fixed thresholds. The dynamic weight threshold is calculated based on the health status, the scaling baseline of the server in a healthy state, and the maximum scaling ratio in a dangerous state. The health status is calculated based on CPU stress score, memory stress score, and load stress score, reflecting the actual state of the server. The dynamic weight threshold is close to the actual carrying capacity, balancing stability and matching accuracy.
[0020] Optionally, the step of de-identifying the original data based on the matched rule object to obtain de-identified data includes: The top-level structural features of the original data are obtained. When the top-level structural features are JSON structures, the system automatically switches to JSON full processing mode, parses the JSON structure in real time using the JsonPath library, locates the nodes of the JSON structure to be de-identified based on the matched rule objects, and applies the de-identification strategy of the matched rule objects to the nodes to be de-identified to obtain de-identified data. When the top-level structure feature is an object structure, it automatically switches to field-level processing mode, uses reflection to access the data fields of the original data, and constructs a field cache of the data fields through ConcurrentHashMap. Based on the matched rule object, it locates the field to be de-identified in the field cache, applies the de-identification strategy of the matched rule object to the field to be de-identified, and obtains the de-identified data.
[0021] As described above, the dual-mode adaptive top-level structure of the original data overcomes the limitations of the traditional single-mode approach, eliminating the need to deploy multiple data masking systems, reducing operational costs, and avoiding performance overhead and data risks associated with cross-structure conversion. In the full JSON processing mode, the JsonPath library enables real-time parsing and precise location of nodes to be masked, reducing memory usage and avoiding memory overflow risks. Simultaneously, the masking strategy is directly applied to the target nodes, eliminating the need to traverse the entire document and perform batch modifications, thus improving masking efficiency. In the field-level processing mode, reflection and field caching reduce resource overhead, while precisely locating the fields to be masked and applying masking strategies improves masking accuracy.
[0022] Optionally, it also includes: The system continuously monitors the existing requests of the original dynamic rule engine and determines whether the existing requests are empty. If so, it asynchronously destroys the rule object and de-identified rule corresponding to the original dynamic rule engine.
[0023] As described above, it is crucial to accurately control the timing of destroying the rule objects and de-identified rules corresponding to the original dynamic rule engine. This prevents premature destruction from interrupting unprocessed resource requests and causing de-identification anomalies, while also preventing excessively long destruction times from wasting resources due to the rule objects and de-identified rules consuming resources. Asynchronous destruction is employed to avoid blocking the main thread and ensure stability.
[0024] In a second aspect, the present invention provides a data dynamic desensitization system that achieves zero intrusion, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the data dynamic desensitization method that achieves zero intrusion as described in the first aspect.
[0025] The technical effects of the data dynamic desensitization system that achieves zero intrusion provided in the second aspect are the same as those of the data dynamic desensitization method that achieves zero intrusion provided in the first aspect. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a zero-intrusion dynamic data desensitization method provided in this embodiment; Figure 2This is a schematic diagram of the overall process of a zero-intrusion dynamic data desensitization method provided in this embodiment; Figure 3 This is a schematic diagram of a data dynamic desensitization system that achieves zero intrusion, as provided in this embodiment.
[0027] [Explanation of Labels in the Attached Image] 1. A data dynamic desensitization system that achieves zero intrusion; 2. Processor; 3. Memory. Detailed Implementation
[0028] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.
[0029] Example 1 Please refer to Figures 1 to 2 This invention provides a method for achieving zero-intrusion dynamic data desensitization, comprising the following steps: S1. The server obtains and loads the de-identification rules from the configuration source, parses the de-identification rules into rule objects in memory, and builds the original dynamic rule engine based on the rule objects. At the same time, it listens to the configuration information of the configuration source. When the configuration information changes, it automatically triggers the update program, reloads and parses the de-identification rules corresponding to the changed configuration information to update the rule objects, obtains the updated rule objects, and builds the current dynamic rule engine based on the updated rule objects. In this embodiment, as Figure 2 As shown, when the application starts, the server retrieves and loads the de-identification rules from the configuration source. The configuration resource is a configuration center or configuration file. Administrators define the de-identification rules through the configuration center or configuration file, parsing the rules into rule objects in memory. The rule object is the structured carrier of the de-identification rule, including: object class name, object field name, object JSON path, matching conditions, de-identification strategy, index identifier, etc. The original dynamic rule engine is built based on the rule object. Simultaneously, the server monitors the configuration information from the configuration source. When the configuration information changes, instead of restarting the application, an update program is automatically triggered to reload and parse the de-identification rules corresponding to the changed configuration information to update the rule object, obtaining the updated rule object. The current dynamic rule engine is then built based on the updated rule object.
[0030] S2. Obtain the business request received from the client, and dynamically switch between the original dynamic rule engine and the current dynamic rule engine using atomic references according to the business request, so as to match the original data of the business request with the corresponding rule object to obtain the matched rule object. During the serialization process of the original data, the original data is desensitized according to the matched rule object to obtain desensitized data, and the desensitized data is returned to the client.
[0031] In this embodiment, as Figure 2 As shown, the server receives business requests from the client. For each business request received from the client, the server generates a unique request identifier and marks the lifecycle stage in the context of the business request. The lifecycle stages include: entering the processing stage and not entering the processing stage. The processing stage includes the processing stage and the de-identification stage, namely: the business logic execution stage and the serialization stage after the business logic is completed. Based on the business request, the server dynamically switches between the original dynamic rule engine and the current dynamic rule engine using atomic references to match the original data of the business request with the corresponding rule object, obtaining the matched rule object. During the serialization process of the original data, that is, when the original data is about to be output, the original data is de-identified based on the matched rule object, without traversing the entire document or repeatedly copying the original data. The obtained de-identified data is then returned to the client.
[0032] At this point, step S2, which involves dynamically switching between the original dynamic rule engine and the current dynamic rule engine using atomic references based on the business request, to match the original data of the business request with the corresponding rule object, includes: S21. Determine whether the business request has entered the processing stage. If so, obtain the original data of the business request and route the business request to the original dynamic rule engine using atomic references. Then, match the original data with the rule object corresponding to the original dynamic rule engine through the original dynamic rule engine. S22. If not, generate the original data corresponding to the business request, route the business request to the current dynamic rule engine using atomic references, and match the original data with the rule object corresponding to the current dynamic rule engine through the current dynamic rule engine.
[0033] In this embodiment, as Figure 2As shown, the lifecycle stages of a business request indicate whether it has entered the processing stage. If the request has entered the processing stage, it means its business logic has been completed and raw data has been generated. Therefore, the raw data is directly retrieved, and the request is routed to the original dynamic rule engine using atomic references. The original dynamic rule engine then matches the raw data with its corresponding rule object, i.e., it uses the unupdated rule object. Conversely, if the request has not entered the processing stage, it means its business logic has not yet been completed. Therefore, the raw data for the request needs to be generated first, and then the request is routed to the current dynamic rule engine using atomic references. The current dynamic rule engine then matches the raw data obtained at this point with its corresponding rule object.
[0034] At this point, step S2, which involves matching the original data of the business request with the corresponding rule object to obtain the matched rule object, includes: S23. Match the data class name, data field name, and data JSON path of the original data with the object class name, object field name, and object JSON path of the corresponding rule object to obtain all candidate rule objects; S24. Perform five-dimensional feature extraction on each candidate rule object using a feature extractor to obtain the five-dimensional features of each candidate rule object. Obtain the priority weight of each candidate rule object based on the five-dimensional features of each candidate rule object. Select the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object. The five-dimensional features are: path features, field features, class matching features, condition features, and rule features.
[0035] In this embodiment, as Figure 2 As shown, the matched rule objects have undergone two levels of filtering. First, rule objects completely unrelated to the original data's data class name, data field name, and data JSON path are directly excluded based on the original data's data structure, resulting in all candidate rule objects. Then, a feature extractor performs five-dimensional feature extraction on each candidate rule object, including path features, field features, class matching features, condition features, and rule features. The priority weight is calculated based on the five-dimensional features of each candidate rule object, and the candidate rule object with the highest priority weight is selected as the matched rule object. In other words, priority weight is used to filter the matched rule objects.
[0036] At this point, step S24 includes: S241. Calculate the path depth, number of operators, and number of function calls of the JSON path of each candidate rule object. Input the path depth, number of operators, and number of function calls into the first feature formula for calculation to obtain the path feature of each candidate rule object. The first feature formula is: ; in, Indicate path features, Indicates path weight, Indicates operator weight, express Weight; S242. Calculate the first overlap between the object field name and the data field name of the original data in each candidate rule object, and simultaneously obtain the field matching pattern between the object field name and the numeric field name. Input the first overlap and the field matching pattern into the second feature formula for calculation to obtain the field features of each candidate rule object. The second feature formula is: ; in, Indicates field characteristics, Indicates the first overlapping weight. Indicates the field matching weight; S243. Calculate the second overlap between the class package path depth corresponding to the object class name in each candidate rule object and the class package path depth corresponding to the data class name in the original data. Simultaneously, obtain the class matching pattern between the object class name and the data class name. Input the second overlap and the class matching pattern into a third feature formula for calculation to obtain the class feature of each candidate rule object. The third feature formula is: ; in, Representing class features, Indicates the second overlapping weight. Indicates class matching weight; S244. Obtain the matching conditions for each candidate rule object, calculate the number of operators and the number of variable references for the matching conditions, and match the matching conditions with the field values of the original data to generate matching results. S245. Input the matching result, the number of operators, and the number of variable references into the fourth feature formula for calculation to obtain the conditional features of each candidate rule object. The fourth feature formula is: ; in, Indicates conditional features, Indicates the matching weight. express Weight, express Weight; S246. Obtain the desensitization strategy and the domain of the original data for each candidate rule object. Input the desensitization strategy and the domain into the fifth feature formula for calculation to obtain the rule feature of each candidate rule object. The fifth feature formula is: ; in, Representing rule features, Indicates the strategy weights. Represents the domain weight; S247. Input the path features, field features, class matching features, condition features, and rule features of each candidate rule object into the first weight formula for calculation to obtain the priority weight of each candidate rule object. The first weight formula is: ; in, This represents the priority weight of candidate rule object i. Indicate path features, Indicates field characteristics, Representing class features, Indicates conditional features, Representing rule features, Indicates path weight, Indicates field weight. Indicates class weight, Indicates conditional weights, Indicates the rule weight; S248. Select the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object.
[0037] In this embodiment, the path feature of each candidate rule object is calculated based on the path depth, number of operators, and number of function calls in the object's JSON path. The field feature is calculated based on the first overlap between the object's field name and the data's field name, and the field matching pattern. The field matching pattern includes exact match and wildcard match. When the field matching pattern is an exact match, it is assigned a value of 1.0. When the field matching pattern is a wildcard match, the wildcard degree is 100%, and the field matching pattern is assigned a value of 1.0, decreasing sequentially according to the wildcard degree. The class feature is calculated based on the second overlap between the class package path depth corresponding to the object's class name and the class package path depth corresponding to the data's class name, and the class matching pattern. The class matching pattern is the same as the field matching pattern, which is also an exact match and a wildcard match, and the assigned value of the class matching pattern is also the same as the assigned value of the field matching pattern. Conditional features are calculated based on the matching results generated from the matching conditions and the field values of the original data, as well as the number of operators and variable references in the matching conditions. The matching results include: successful match and failed match. A successful match is assigned a value of 1.0, and a failed match is assigned a value of 0. Rule features are calculated based on the domain to which the de-identified object and the original data belong. The domain includes: global domain, application domain, module domain, and API domain. Different domains correspond to different values. For example, the global domain is assigned a value of 0.3, the application domain a value of 0.5, the module domain a value of 0.7, and the API domain a value of 0.9. Specific values can be adjusted according to the actual situation.
[0038] At this point, step S348 includes: S2481. Determine whether the number of matched rule objects is greater than 1. If so, sort the matched rule objects in descending order according to their priority weights to obtain a descending sorted sequence. S2482. Calculate the weight difference between the priority weight of the first matched rule object in the descending sorted sequence and the priority weight of the second matched rule object. Determine whether the weight difference is greater than the weight threshold. If so, take the first matched rule object in the descending sorted sequence as the final matched rule object. If not, trigger a multi-level arbitration mechanism to determine whether the update time of the first matched rule object in the descending sorted sequence is the same as the update time of the second matched rule object. S2483. If they are the same, determine whether the rule ID of the first matched rule object in the descending sort sequence is less than the rule ID of the second matched rule object. If yes, take the first matched rule object in the descending sort sequence as the final matched rule object. If no, take the second matched rule object in the descending sort sequence as the final matched rule object. S2484. If they are not the same, determine whether the update time of the first matched rule object in the descending sort sequence is later than the update time of the second matched rule object. If yes, take the first matched rule object in the descending sort sequence as the final matched rule object. If no, take the second matched rule object in the descending sort sequence as the final matched rule object.
[0039] In this embodiment, if the number of matched rule objects is greater than one, i.e., there are multiple rule objects that match the original data, the matched rule objects are sorted in descending order according to their priority weights. The weight difference between the priority weights of the first two matched rule objects in the descending sort sequence is calculated. If the weight difference is greater than the weight threshold, the matched rule object is directly obtained according to its priority weight; that is, the matched rule object ranked first in the descending sort sequence is taken as the final matched rule object. Conversely, if the weight difference is not greater than the weight threshold, a multi-level arbitration mechanism is triggered: update time and rule ID. If the update times of the first two matched rule objects in the descending sort sequence are different, the matched rule object with the earlier update time is taken as the final matched rule object. If the update times are the same, the matched rule object with the smaller rule ID is taken as the final matched rule object.
[0040] In this embodiment, the weight threshold includes a dynamic weight threshold and a preset weight threshold. The preset weight threshold is 0.03, which can be designed according to the actual situation. The dynamic weight threshold is calculated according to the actual situation of the system. The calculation steps of the dynamic weight threshold are as follows: Obtain the current CPU idle rate, current used heap memory, maximum heap memory, current load, and number of CPU cores of the server. At the same time, obtain the scaling baseline of the server in a healthy state and the maximum scaling ratio in a dangerous state. The current CPU idle rate is input into the first pressure formula for calculation to obtain the CPU pressure score. The first pressure formula is: ; The currently used heap memory and the maximum heap memory are input into the second pressure formula to calculate the memory pressure score. The second pressure formula is as follows: ; The current load and the number of CPU cores are input into the third stress formula to calculate the load stress score. The third stress formula is as follows: ; The CPU stress score, memory stress score, and load stress score are input into a first health formula for calculation to obtain the health score. The first health formula is: ; in, Indicates CPU weight. express , express ; The health score, the scaling baseline, and the maximum scaling ratio are input into a second health formula to calculate the health coefficient. The health formula is as follows: ; in, Indicates the nonlinear coefficient; The health coefficient is input into a first dynamic formula for calculation to obtain a dynamic weight threshold. It is then determined whether the weight difference is greater than the dynamic weight threshold. The first dynamic formula is: ; in, This represents the base threshold.
[0041] In this embodiment, a CPU stress score is calculated based on the server's current CPU idle rate, a memory stress score is calculated based on the server's current used heap memory and maximum heap memory, and a load stress score is calculated based on the server's current load and number of CPU cores. A health score is then calculated based on these three dimensions: CPU stress score, memory stress score, and load stress score. A health coefficient is calculated based on the obtained health score and the server's scaling baseline in a healthy state and its maximum scaling ratio in a dangerous state. Finally, a dynamic weighted threshold is obtained based on the health coefficient and a base threshold. The base threshold is 0.05.
[0042] At this point, step S2, which involves desensitizing the original data based on the matched rule object to obtain desensitized data, includes: S25. Obtain the top-level structural features of the original data. When the top-level structural features are JSON structures, automatically switch to JSON full processing mode, parse the JSON structure in real time using the JsonPath library, locate the nodes to be de-identified in the JSON structure according to the matched rule objects, apply the de-identification strategy of the matched rule objects to the nodes to be de-identified, and obtain the de-identified data. S26. When the top-level structure feature is an object structure, automatically switch to field-level processing mode, use reflection to access the data fields of the original data, and build a field cache of the data fields through ConcurrentHashMap. Locate the field to be de-identified in the field cache according to the matched rule object, apply the de-identification strategy of the matched rule object to the field to be de-identified, and obtain the de-identified data.
[0043] In this embodiment, as Figure 2 As shown, a dual-mode adaptive mechanism is employed during data anonymization. When the top-level structure of the original data is JSON, it automatically switches to full JSON processing mode. The JsonPath library parses the JSON structure in real time, locates the nodes to be anonymized based on matching rule objects, directly applies the anonymization strategy to these nodes, modifies their values, and outputs the modified values using streaming processing technology, thus obtaining the anonymized data. When the top-level structure of the original data is an object structure (including Java and Python objects), it automatically switches to field-level processing mode. It uses reflection to access the data fields of the original data and builds a field cache using ConcurrentHashMap. That is, after the first reflection access, a field cache corresponding to the data field is built. Subsequent accesses to the field cache directly locate the fields to be anonymized based on matching rule objects, apply the anonymization strategy directly to these fields, and obtain the anonymized data.
[0044] In this embodiment, the original data with an object structure as its top-level structure is further divided into sub-scenes. If the original data is a collection type (i.e., a collection-type sub-scene), the number of elements in the collection is automatically detected. If the number of elements exceeds the element threshold, parallel stream processing is automatically switched. If the original data is a deeply nested type (i.e., a deeply nested sub-scene), a recursive algorithm is used to traverse the nested fields and calculate the nesting depth. When the nesting depth exceeds the depth threshold, a stack overflow protection mechanism is automatically triggered, converting to iterative traversal. Recursion is simulated using a stack data structure to ensure that traversal and de-identification are not interrupted.
[0045] This embodiment also includes a mechanism for destroying the original dynamic rule engine, the specific steps of which are as follows: The system continuously monitors the existing requests of the original dynamic rule engine and determines whether the existing requests are empty. If so, it asynchronously destroys the rule object and de-identified rule corresponding to the original dynamic rule engine.
[0046] In this embodiment, the existing requests of the original dynamic rule engine are counted in real time. That is, the existing requests routed to the original dynamic rule engine are processed. When all existing requests of the original dynamic rule engine are processed, that is, when the existing requests are empty, the rule objects and de-identified rules corresponding to the original dynamic rule engine can be asynchronously destroyed to release memory.
[0047] Example 2 Please refer to Figure 3 The present invention provides a data dynamic desensitization system 1 that achieves zero intrusion, including a memory 3, a processor 2, and a computer program stored on the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, it implements the steps in Embodiment 1.
[0048] Since the systems / devices described in the above embodiments of the present invention are systems / devices used to implement the methods of the above embodiments of the present invention, those skilled in the art can understand the specific structure and modifications of the systems / devices based on the methods described in the above embodiments of the present invention, and therefore will not be repeated here. All systems / devices used in the methods of the above embodiments of the present invention fall within the scope of protection of the present invention.
[0049] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0050] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0051] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.
[0052] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0053] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0054] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.
Claims
1. A method for achieving zero-intrusion dynamic data desensitization, characterized in that, include: The server obtains and loads the de-identification rules from the configuration source, parses the de-identification rules into rule objects in memory, and builds the original dynamic rule engine based on the rule objects. At the same time, it listens for the configuration information of the configuration source. When the configuration information changes, it automatically triggers the update program, reloads and parses the de-identification rules corresponding to the changed configuration information to update the rule objects, obtains the updated rule objects, and builds the current dynamic rule engine based on the updated rule objects. The system receives a business request from the client, dynamically switches between the original dynamic rule engine and the current dynamic rule engine using atomic references based on the business request, matches the original data of the business request with the corresponding rule object to obtain a matched rule object, and desensitizes the original data based on the matched rule object during the serialization process of the original data to obtain desensitized data, and returns the desensitized data to the client.
2. The data dynamic desensitization method for achieving zero intrusion as described in claim 1, characterized in that, The step of dynamically switching between the original dynamic rule engine and the current dynamic rule engine using atomic references based on the business request, so as to match the original data of the business request with the corresponding rule object, includes: Determine whether the business request has entered the processing stage. If so, obtain the original data of the business request and route the business request to the original dynamic rule engine using atomic references. Then, match the original data with the rule object corresponding to the original dynamic rule engine through the original dynamic rule engine. If not, then generate the original data corresponding to the business request, route the business request to the current dynamic rule engine using atomic references, and match the original data with the rule object corresponding to the current dynamic rule engine through the current dynamic rule engine.
3. The data dynamic desensitization method for achieving zero intrusion as described in claim 2, characterized in that, The processing stage includes a processing stage and a desensitization stage.
4. The data dynamic desensitization method for achieving zero intrusion as described in claim 1, characterized in that, The step of matching the original data of the business request with the corresponding rule object to obtain the matched rule object includes: The data class name, data field name, and data JSON path of the original data are matched with the object class name, object field name, and object JSON path of the corresponding rule object to obtain all candidate rule objects; Five-dimensional feature extraction is performed on each candidate rule object by a feature extractor to obtain the five-dimensional feature of each candidate rule object. The priority weight of each candidate rule object is obtained based on the five-dimensional feature of each candidate rule object. The candidate rule object with the highest priority weight is selected as the matched rule object from all the priority weights of the candidate rule objects. The five-dimensional features are: path features, field features, class matching features, condition features, and rule features.
5. The data dynamic desensitization method for achieving zero intrusion as described in claim 4, characterized in that, The step of extracting five-dimensional features from each candidate rule object using a feature extractor to obtain the five-dimensional features of each candidate rule object, obtaining the priority weight of each candidate rule object based on the five-dimensional features of each candidate rule object, and selecting the candidate rule object with the highest priority weight from all candidate rule object priority weights as the matched rule object includes: Calculate the path depth, number of operators, and number of function calls in the JSON path of each candidate rule object. Input the path depth, number of operators, and number of function calls into the first feature formula for calculation to obtain the path feature of each candidate rule object. The first feature formula is: ; in, Indicate path features, Indicates path weight, Indicates operator weight, express Weight; Calculate the first overlap between the object field name and the data field name of the original data in each candidate rule object, and simultaneously obtain the field matching pattern between the object field name and the numeric field name. Input the first overlap and the field matching pattern into a second feature formula for calculation to obtain the field features of each candidate rule object. The second feature formula is: ; in, Indicates field characteristics, Indicates the first overlapping weight. Indicates the field matching weight; Calculate the second overlap degree between the class package path depth corresponding to the object class name in each candidate rule object and the class package path depth corresponding to the data class name in the original data. Simultaneously, obtain the class matching pattern between the object class name and the data class name. Input the second overlap degree and the class matching pattern into a third feature formula for calculation to obtain the class feature of each candidate rule object. The third feature formula is: ; in, Representing class features, Indicates the second overlapping weight. Indicates class matching weight; Obtain the matching conditions for each candidate rule object, calculate the number of operators and variable references for the matching conditions, and match the matching conditions with the field values of the original data to generate matching results; The matching result, the number of operators, and the number of variable references are input into the fourth feature formula for calculation to obtain the conditional features of each candidate rule object. The fourth feature formula is: ; in, Indicates conditional features, Indicates the matching weight. express Weight, express Weight; Obtain the desensitization strategy and the domain of the original data for each candidate rule object. Input the desensitization strategy and the domain into the fifth feature formula for calculation to obtain the rule feature of each candidate rule object. The fifth feature formula is: ; in, Representing rule features, Indicates the strategy weights. Represents the domain weight; The path features, field features, class matching features, condition features, and rule features of each candidate rule object are input into the first weight formula for calculation, resulting in the priority weight of each candidate rule object. The first weight formula is as follows: ; in, This represents the priority weight of candidate rule object i. Indicate path features, Indicates field characteristics, Representing class features, Indicates conditional features, Representing rule features, Indicates path weight, Indicates field weight. Indicates class weight, Indicates conditional weights, Indicates the rule weight; Select the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object.
6. The data dynamic desensitization method for achieving zero intrusion as described in claim 5, characterized in that, The step of selecting the candidate rule object with the highest priority weight from all candidate rule objects as the matched rule object includes: Determine whether the number of matched rule objects is greater than 1. If so, sort the matched rule objects in descending order according to their priority weights to obtain a descending sorted sequence. Calculate the weight difference between the priority weight of the first matched rule object and the priority weight of the second matched rule object in the descending sort sequence. Determine whether the weight difference is greater than the weight threshold. If so, take the first matched rule object in the descending sort sequence as the final matched rule object. If not, trigger a multi-level arbitration mechanism to determine whether the update time of the first matched rule object in the descending sort sequence is the same as the update time of the second matched rule object. If they are the same, determine whether the rule ID of the first matched rule object in the descending sort sequence is less than the rule ID of the second matched rule object. If yes, take the first matched rule object in the descending sort sequence as the final matched rule object. If no, take the second matched rule object in the descending sort sequence as the final matched rule object. If they are not the same, determine whether the update time of the first matched rule object in the descending sorted sequence is later than the update time of the second matched rule object. If yes, the first matched rule object in the descending sorted sequence is taken as the final matched rule object. If no, the second matched rule object in the descending sorted sequence is taken as the final matched rule object.
7. The data dynamic desensitization method for achieving zero intrusion as described in claim 6, characterized in that, The weight threshold includes a dynamic weight threshold. When the weight threshold is a dynamic weight threshold, determining whether the weight difference is greater than the weight threshold includes: Obtain the current CPU idle rate, current used heap memory, maximum heap memory, current load, and number of CPU cores of the server. At the same time, obtain the scaling baseline of the server in a healthy state and the maximum scaling ratio in a dangerous state. The current CPU idle rate is input into the first pressure formula for calculation to obtain the CPU pressure score. The first pressure formula is: ; The currently used heap memory and the maximum heap memory are input into the second pressure formula to calculate the memory pressure score. The second pressure formula is as follows: ; The current load and the number of CPU cores are input into the third stress formula to calculate the load stress score. The third stress formula is as follows: ; The CPU stress score, memory stress score, and load stress score are input into a first health formula for calculation to obtain the health score. The first health formula is: ; in, Indicates CPU weight. express , express ; The health score, the scaling baseline, and the maximum scaling ratio are input into a second health formula to calculate the health coefficient. The health formula is as follows: ; in, Indicates the nonlinear coefficient; The health coefficient is input into a first dynamic formula for calculation to obtain a dynamic weight threshold. It is then determined whether the weight difference is greater than the dynamic weight threshold. The first dynamic formula is: ; in, This represents the base threshold.
8. The data dynamic desensitization method for achieving zero intrusion as described in claim 1, characterized in that, The step of de-identifying the original data based on the matched rule object to obtain de-identified data includes: The top-level structural features of the original data are obtained. When the top-level structural features are JSON structures, the system automatically switches to JSON full processing mode, parses the JSON structure in real time using the JsonPath library, locates the nodes of the JSON structure to be de-identified based on the matched rule objects, and applies the de-identification strategy of the matched rule objects to the nodes to be de-identified to obtain de-identified data. When the top-level structure feature is an object structure, it automatically switches to field-level processing mode, uses reflection to access the data fields of the original data, and constructs a field cache of the data fields through ConcurrentHashMap. Based on the matched rule object, it locates the field to be de-identified in the field cache, applies the de-identification strategy of the matched rule object to the field to be de-identified, and obtains the de-identified data.
9. A method for achieving zero-intrusion dynamic data desensitization as described in claim 1, characterized in that, Also includes: The system continuously monitors the existing requests of the original dynamic rule engine and determines whether the existing requests are empty. If so, it asynchronously destroys the rule object and de-identified rule corresponding to the original dynamic rule engine.
10. A data dynamic desensitization system achieving zero intrusion, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 9.