Non-invasive ai-enhanced dynamic access control and sensitive data protection method and system
By adopting a non-intrusive AI-enhanced dynamic access control method in Java microservice architecture, the problems of intrusive modification and static permission in sensitive data protection in Java microservice architecture are solved. It realizes accurate identification of sensitive data and dynamic policy decision-making, improves the intelligence and dynamism of data security protection, and is suitable for enterprise-level Java distributed applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG ENERGY DIGITAL TECH CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-03
AI Technical Summary
Existing sensitive data protection technologies in Java microservice architectures suffer from problems such as high invasiveness requiring modification, inability to dynamically adjust permissions, inability to adapt to complex business scenarios, and poor consistency across the entire chain, making it difficult to balance security risks and business continuity.
A non-intrusive AI-enhanced dynamic access control method is adopted. Non-intrusive aspect-pointers are implanted through Java Agent when Java application starts, collect context information, perform preprocessing and standardization, combine multi-factor weighted quantization algorithm and AI model to identify risk level and sensitivity level, execute dynamic policy decision, and ensure consistency through end-to-end context pass-through mechanism, and monitor performance indicators in real time to ensure business continuity.
It achieves zero-intrusion of business code, dynamic risk quantification, accurate identification of sensitive data, and adaptive decision-making strategies in Java microservice architecture, ensuring consistency of decision-making across the entire chain, improving the intelligence and dynamism of data security protection, and is suitable for enterprise-level Java distributed applications.
Smart Images

Figure CN122333494A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data security and artificial intelligence interdisciplinary technology, specifically relating to a non-intrusive AI-enhanced dynamic access control and sensitive data protection method and system applied to Java microservice architecture. Background Technology
[0002] As digital transformation deepens, the scale of sensitive data carried by enterprise Java distributed applications continues to expand, including personal identity information, core trade secrets, and sensitive government data. Security risks such as data breaches and unauthorized access are becoming increasingly prominent. The widespread adoption of distributed microservice architectures has led to more complex access scenarios and more frequent data flows, making traditional access control and sensitive data protection technologies insufficient to meet the needs of complex business scenarios.
[0003] Existing sensitive data protection technologies have the following shortcomings: 1. Intrusive modifications: Most existing security solutions involve modifying the source code of business systems and adding data anonymization code, which requires recompiling and repackaging. This results in high system modification costs and long deployment cycles, making it unsuitable for the rapid deployment needs of large-scale Java microservice clusters in enterprises.
[0004] 2. Static access control: Existing technologies only assign fixed data access permissions based on preset roles, and cannot dynamically adjust permissions according to the user's access context (identity, device, geographical location, access behavior, etc.). This can easily lead to problems of excessive or insufficient permissions, and cannot cope with sudden security risks. It is also difficult to adapt to the dynamic business scenarios of Java microservice architecture. Summary of the Invention
[0005] The purpose of this invention is to overcome the above-mentioned deficiencies of the prior art and provide a non-intrusive AI-enhanced dynamic access control and sensitive data protection method and system. The technical solution adopted by this invention is as follows: A non-intrusive AI-enhanced dynamic access control and sensitive data protection method includes the following steps: S1. Based on the Java Agent, dynamic loading is completed when the target Java application starts. Non-intrusive aspects and pointcuts are implanted in the core nodes of the entire Java application chain to receive user access requests and collect user access context information through non-intrusive aspects and pointcuts. S2. Preprocess the collected context information, remove invalid and abnormal data, and standardize the data. Convert unstructured information into structured features and generate context feature vectors in a unified format. S3. Based on context feature vectors, perform context awareness and dynamic risk assessment to output risk level, and use AI to enhance intelligent identification of sensitive data to output sensitivity level; S4. Based on risk level and sensitivity level, execute dual decision logic for access control and de-identification strategy, and output access control results and sensitive data de-identification strategy simultaneously. S5. Based on the end-to-end context lossless pass-through mechanism, a globally unique TraceID is generated as the context identifier. Dynamic hash verification is used to prevent context tampering. Access control results, desensitization policies and context information are synchronized to all nodes in the distributed architecture to ensure the consistency of decisions of each node and prevent context loss or tampering. S6. Monitor system performance indicators in real time. When system performance indicators trigger preset degradation thresholds, execute level 1, level 2, or level 3 degradation strategies to ensure uninterrupted business operation. When system performance recovers, smoothly restore system functions through gradient recovery algorithms to avoid system jitter.
[0006] Preferably, in S3, the specific steps for performing context-aware and dynamic risk assessment include: integrating five core risk factors—identity and permission anomalies, device trust anomalies, geographical location anomalies, access behavior anomalies, and resource sensitivity anomalies—and employing three algorithms—multi-factor weighted quantization algorithm, user behavior baseline deviation analysis based on sliding window, and lightweight incremental isolated forest anomaly identification—to collaboratively calculate a dynamic risk score, which is then mapped to four risk levels: low, medium, high, and extremely high. The specific steps for AI-enhanced intelligent identification of sensitive data include: using a fusion of regularization rules and a lightweight BiLSTM+CRF sequence labeling model to identify sensitive data in accessed resources; adapting to new types of sensitive data through zero-shot learning; and simultaneously using a quantification formula to determine the sensitivity level of the sensitive data, mapping it to four levels: non-sensitive, internally sensitive, highly sensitive, and top secret.
[0007] Preferably, the steps for analyzing user behavior baseline deviation based on a sliding window are as follows: define the time window and sliding step size, collect user behavior statistical vectors within the window, calculate the historical baseline vectors for the same time period over the past 30 days, and calculate the behavior deviation using L2 Euclidean distance; Isolation forest supports daily incremental pruning and retraining based on labeled samples.
[0008] Preferably, the lightweight BiLSTM+CRF sequence labeling model includes: word embedding of the input text sequence, extraction of contextual features through forward LSTM and backward LSTM to obtain the final feature vector; calculation of the global score of the label sequence through the CRF layer, solving for the optimal label sequence through the Viterbi algorithm to obtain the boundary and type of sensitive entities, and calculating the entity confidence; and adaptation to new sensitive data through zero-shot learning, specifically: based on a pre-trained Chinese word vector model, calculating the cosine similarity between the text to be identified and the descriptive text of the new sensitive data, and determining the corresponding sensitive entity when the cosine similarity is ≥ a preset threshold, without the need to retrain the AI model.
[0009] Preferably, in S4, the access control result is determined by a Boolean decision function to allow or deny access, and rate limiting is automatically triggered in high-risk scenarios; the de-identification strategy is determined by a three-dimensional linkage formula of de-identification granularity, de-identification method and execution scope to achieve adaptive de-identification.
[0010] Preferably, the specific steps to achieve adaptive desensitization are as follows: Desensitization particle size G = min(1, G base ×(1+R / 100)×(1−Auth(identity)), where G base The basic desensitization granularity corresponds to the sensitivity level S: non-sensitive = 0, internally sensitive = 0.3, highly sensitive = 0.7, and top secret = 1. The desensitization method M is selected using the fit score formula: Score(Mk) = W s ×S suit (M k ,S)+W r ×R suit (M k ,R)+W a ×A suit (M k ,Auth), M final =argmax k Score(M k ), where W s +W r +W a =1;S suit To assess the adaptability of desensitization methods to sensitivity levels, R suit To adapt to risk levels, A suit To ensure adaptability to identity permissions, all three values are [0,1]. The desensitization execution range is E=min(2,E base ×(1+R / 50)), where E base =1, when R≥50, expand to the associated sensitive fields, when R≥80, E=2 (execute on all fields).
[0011] Preferably, in S5, the end-to-end context lossless pass-through mechanism specifically includes: TraceID = Hex(MD5(IP+Timestamp+UUID+ThreadID)), where IP is the application instance IP address, Timestamp is the millisecond-level timestamp of the request arrival, UUID is a 128-bit random UUID, ThreadID is the request processing thread ID, Hex() is the hexadecimal encoding function, and MD5 is the hash function. The formula for preventing context tampering through hash verification is H=SHA256(Serialize(Context)+TraceID+Salt), where H is the context verification hash value, Serialize() is the normalized serialization function for context information, SHA256() is the secure hash algorithm 256 function, Serialize(Context) is the serialized string of context information, and Salt is a dynamic salt value bound to the application instance and timestamp, which is updated every minute. The cross-thread / cross-service pass-through formula is Context. child =Context parent ×I(TraceID child ==TraceID parent When the TraceID matches, the child thread / downstream service fully inherits the parent context; otherwise, it is reinitialized.
[0012] Preferably, in S1, the core node includes at least a request entry point, a cross-service call node, a cross-thread execution node, and a data return node, and the context information includes at least identity information, device information, geographical location information, access behavior information, and access resource information.
[0013] Preferably, in S6, system performance indicators include the percentage increase in service response time, CPU utilization, memory usage, and service anomaly rate.
[0014] A non-intrusive AI-enhanced dynamic access control and sensitive data protection method, used to implement the aforementioned non-intrusive AI-enhanced dynamic access control and sensitive data protection method, includes: The non-intrusive aspect implantation module is used to dynamically load non-intrusive aspects and pointcuts through the Java Agent when the Java application starts, and to implant non-intrusive aspects and pointcuts into the core nodes of the entire Java application chain, so as to achieve zero intrusion of business code and provide a carrier for data collection and strategy execution for other modules. The context acquisition and preprocessing module is used to acquire multi-dimensional context information through non-intrusive face and cutpoint, complete data preprocessing, and generate context feature vectors. The dynamic risk assessment module is used to integrate multi-dimensional risk factors and output dynamic risk scores and corresponding risk levels. The sensitive data identification module is used to identify sensitive data by fusing regular expressions and AI models. It adapts to new types of sensitive data through zero-shot learning and outputs the sensitivity level judgment result. The dynamic policy execution engine module is used to execute dual decision logic for access control and de-identification policies, and outputs access control results and sensitive data de-identification policies. The end-to-end context pass-through and verification module is used to perform lossless pass-through and consistency verification mechanisms to ensure end-to-end decision consistency. The performance monitoring and degradation recovery module is used to execute tiered degradation and gradient recovery strategies to ensure uninterrupted business operation. The context acquisition and preprocessing module, dynamic risk assessment module, sensitive data identification module, dynamic policy execution engine module, end-to-end context pass-through and verification module, and performance monitoring and degradation recovery module complete data interaction and policy execution through the non-intrusive aspect insertion point of the non-intrusive aspect implantation module, forming a closed loop of end-to-end security protection.
[0015] The beneficial effects of this invention are: This invention achieves zero-intrusion into business code based on Java Agent bytecode enhancement technology. It simultaneously enables dynamic risk quantification of access behavior, accurate identification and classification of sensitive data, dynamic adaptation of decision-making strategies, end-to-end decision consistency, and lossless business operation, comprehensively improving the intelligence and dynamism of data security protection for enterprise Java distributed applications. This invention can be quickly deployed without modifying the business source code, balancing data security and business continuity, and is suitable for data security protection scenarios in enterprise-level Java microservice architectures. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is the overall main flowchart of the dynamic access control and sensitive data protection method of Embodiment 1 of the present invention; Figure 2 This is a complete execution flowchart of the dynamic access control and sensitive data protection method according to Embodiment 1 of the present invention; Figure 3 This is a flowchart of the dual decision-making logic for access control and de-identification strategy in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the architecture of the dynamic access control and sensitive data protection system according to Embodiment 2 of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0018] Example 1 like Figure 1-3 As shown in the figure, this utility model provides a non-intrusive AI-enhanced dynamic access control and sensitive data protection method, which includes the following steps: S1. Based on the Java Agent, dynamic loading is completed when the target Java application starts. Non-intrusive aspects and pointcuts are implanted in the core nodes of the entire Java application chain. The core nodes include at least request entry points, cross-service call nodes, cross-thread execution nodes, and data return nodes. User access requests are received, and the context information of user access is collected through non-intrusive aspects and pointcuts. The context information includes at least identity information, device information, geographical location information, access behavior information, and access resource information.
[0019] The term "implanting non-intrusive aspects and pointcuts" refers to dynamically modifying the bytecode of a class using Java Agent bytecode enhancement technologies (such as ASM and Javassist) to execute specific logic at designated locations. For example, this could involve embedding a Spring Controller or Servlet into the Controller layer of a Spring MVC application to perform data collection.
[0020] S2. Preprocess the collected context information, remove invalid and abnormal data, and standardize the data to convert unstructured information into structured features and generate context feature vectors in a unified format.
[0021] The "removal of invalid and abnormal data" can employ existing methods such as null / default value filtering, duplicate data deduplication, rule validation (Schema Validation), and logical consistency verification. The "conversion of unstructured information into structured features" can employ existing methods such as Natural Language Vectorization (NLP Embedding) and sequence behavior feature generation.
[0022] S3, Parallel Dual-Core Analysis: Based on a unified format of context feature vectors, it performs context awareness and dynamic risk assessment to output risk levels, and uses AI to enhance intelligent identification of sensitive data to output sensitivity levels.
[0023] S31. The specific steps for performing context-aware and dynamic risk assessment include: integrating five core risk factors: identity and permission anomalies, device trust anomalies, geographical location anomalies, access behavior anomalies, and resource sensitivity anomalies; employing three algorithms—multi-factor weighted quantization algorithm, user behavior baseline deviation analysis based on sliding window, and lightweight incremental isolated forest anomaly identification—to collaboratively calculate dynamic risk scores and map them to four risk levels: low, medium, high, and extremely high.
[0024] The "identity and permission exception" is used to identify the identity and permissions of the currently accessing user. Specifically, it uses a SpringSecurity / Shiro interceptor (a Java Agent pointcut) to intercept FilterChainProxy or AuthorizationFilter, extracts the currently logged-in user ID, role list (Roles), and permission string (Authorities), and compares the permissions required for the current request with the user's actual permissions through rule matching. If the current request exceeds the user's actual permissions, it is judged as an exception.
[0025] The "device trust anomaly" is used to identify whether the currently accessing user's device is secure. Similar to the previous method: device information (device fingerprint, terminal type, operating system, environmental trust status, etc.) is extracted through a segmentation point, and the device trustworthiness is determined to be abnormal through device fingerprint comparison, environmental integrity verification, and other methods.
[0026] The "abnormal geographical location" method collects the access source IP address or GPS / Wifi location, and determines whether the login geographical location is abnormal through IP geographical location database mapping, cross-regional login detection, etc.
[0027] The "abnormal access behavior" collection collects full-link aspects, such as access record URL, Method, input parameter size, output parameter size, time consumption, call frequency, error code distribution, etc. It uses a sliding window-based user behavior baseline deviation analysis and a lightweight incremental isolated forest to identify whether user behavior is abnormal.
[0028] The "resource sensitivity exception" uses a pointcut to intercept MyBatis / Hibernate's Executor.query, obtain the final executed SQL statement, parse the SQL statement, and check whether it involves sensitive tables (such as users, payments) or sensitive fields (such as id_card, phone) to determine whether the access involves sensitive resources.
[0029] All five types of anomalies mentioned above were analyzed using normalized anomaly analysis (F). i To express.
[0030] The multi-factor weighted quantization algorithm described in step S31 is as follows: ; Where R is the total dynamic risk score, ranging from [0, 100]; n is the total number of risk factors, including at least the five core risk factors mentioned above; W i Let be the weight coefficient of the i-th risk factor, satisfying =1, and the weights support hot updates and incremental learning optimization; F iLet F be the normalized outlier score of the i-th risk factor, with a value range of [0,1]; C is the multi-factor coupling amplification coefficient, with a value range of [1,1.5]. When there are ≥2 core factors F i When the value is ≥0.8, C=1.5; otherwise, C=1.
[0031] When two or more core risk factors are abnormal, it means that the abnormal risk is significantly amplified rather than simply superimposed. Therefore, a coefficient C is introduced to amplify the abnormality when multiple risk factors are abnormal at the same time.
[0032] The user behavior baseline deviation analysis based on the sliding window described in step S31 includes the following specific steps: Define a time window size as T and a sliding step size as Δt, where T ranges from 1 to 60 minutes and Δt ranges from 10 seconds to 10 minutes; collect user behavior statistical vectors within the window. QPS t Average access frequency within the window, vol t For cumulative data access volume, time t For time interval features, scope t For the set of accessed resources; Calculate the historical baseline vector for the same time period over the past 30 days. , where N is the number of historical statistical samples; Calculate behavioral deviation using L2 Euclidean distance After normalization, min(1,D) is taken as the core input of the access behavior anomaly factor F4.
[0033] The behavioral deviation degree D represents the distance between the current real-time behavior and the historical normal habits. A small value indicates that the user's behavior is consistent with the usual habits, while a large value indicates that the user's behavior has undergone a drastic change (which may be due to account theft, operational errors, or new types of attacks).
[0034] Furthermore, baseline deviation analysis is ineffective in identifying certain types of outliers. For example, a user who normally queries one record at a time might suddenly perform 500 queries within 5 minutes at highly regular intervals, retrieving one record each time. In this case, baseline deviation analysis cannot identify this abnormal behavior. Therefore, a lightweight incremental isolated forest anomaly detection method is introduced to identify user behavior anomalies.
[0035] The lightweight incremental isolated forest anomaly identification method described in step S31 uses the following formula to calculate the anomaly score: ; Where S(X,ψ) is the outlier score of a single access sample x, taking values [0,1]; ψ is the number of trees in the isolated forest, ranging from 50 to 200, with a maximum depth limit of 6 to 12 for a single tree; h(x) is the path length of sample x in a single isolated tree, E(h(x)) is the average path length of all trees; and c(ψ) is the average path length of the binary tree for ψ samples. H(i) is the harmonic number, H(i) = ln(i) + γ, where γ is Euler's constant with a value of ≈0.5772; the isolated forest supports daily incremental pruning and retraining based on labeled samples.
[0036] S32. The specific steps for enhancing the intelligent identification of sensitive data through AI include: using a fusion of regular rules and a lightweight BiLSTM+CRF sequence labeling model to identify sensitive data in accessed resources, adapting to new types of sensitive data through zero-shot learning, and using a quantification formula to determine the sensitivity level of sensitive data, mapping it to four levels: non-sensitive, internally sensitive, highly sensitive, and top secret.
[0037] The lightweight BiLSTM+CRF sequence labeling model described in step S32 specifically includes: For the input text sequence Word embedding is performed, and contextual features are extracted using forward LSTM and backward LSTM to obtain the final feature vector. , where ⊕ represents vector concatenation; the input text sequence is the content of the resource accessed this time, such as {"name": "Zhang San", "id_card": "110101199001011234"…} in JSON; The global score of the label sequence y is calculated using a CRF layer. A yt-1,yt Let P be the label transition probability matrix. t,yt The emission probability of the tag corresponding to the token output by BiLSTM; Solving for the optimal label sequence y using the Viterbi algorithm * =argmax y score(X,y) retrieves the boundary and type of the sensitive entity; Calculate entity confidence , where L is the token length of the entity, and entities with Conf≥0.85 are considered as high-confidence identification results.
[0038] The method for fusing the regularization rule with the lightweight BiLSTM+CRF sequence labeling model in step S32 is specifically formulated as follows: ; Where R finalFor the final set of sensitive entity recognition results, R model For the set of high-confidence sensitive entities identified by the AI model with Conf ≥ 0.85, R rule R represents the set of sensitive entities matched by regular expression rules. conflict This is the set of entities that conflict with the model and rule results. Conflicting entities are subject to a secondary verification rule that prioritizes the results of strong regularization matching according to national standards, while other scenarios are based on results with higher confidence.
[0039] The zero-shot learning adaptation of novel sensitive data described in step S32 specifically involves: based on a pre-trained Chinese word vector model, calculating the cosine similarity between the text to be identified and the text describing the novel sensitive data; when the cosine similarity is greater than or equal to a preset threshold, it is determined to be the corresponding sensitive entity, without the need to retrain the AI model.
[0040] The sensitivity level of sensitive data is determined using a quantification formula in step S32. The specific formula is as follows: ; Where S is the comprehensive score of sensitivity level, taking values [0,1]; the weights satisfy W type +W conf +W scope =1;S type The base score for sensitivity level is as follows: Top Secret = 1, Highly Sensitive = 0.7, Internal Sensitive = 0.3, Non-Sensitive = 0; S conf To identify confidence scores, Conf≥0.9=1, 0.7≤Conf<0.9=0.7, and Conf<0.7=0; S scope Data volume is categorized as follows: single data entry = 0.3, 10 ≤ number of entries < 100 = 0.7, and number of entries ≥ 100 = 1. Based on the value of S, it is mapped to four levels: non-sensitive, internally sensitive, highly sensitive, and top secret. The mapping threshold can be dynamically configured according to business scenarios.
[0041] S4, the dynamic policy engine, executes dual decision logic for access control and desensitization policies based on risk level and sensitivity level. The access control result determines whether to allow or deny access through a Boolean decision function, and rate limiting is automatically triggered in high-risk scenarios. The desensitization policy is determined by a three-dimensional linkage formula of desensitization granularity, desensitization method and execution scope to achieve adaptive desensitization. Access control results and sensitive data desensitization policies are output synchronously.
[0042] The Boolean decision function mentioned in step S4 is: ; in, This is an indicator function that returns true (allow access) if all conditions are met, otherwise returns false (deny); Auth(identity) represents the access subject's identity and permission level, with values [0,1]; Sres The access permission levels for resources correspond one-to-one with the sensitivity level S; Trust(device) represents the device's trust level, Trust = 1 - F2, with a value of [0,1], where F2 is the normalized anomaly score of the device's risk factor; T min R is the preset minimum device trust threshold; R is the dynamic risk score. deny This is the threshold for denying access; Match(context, Rule) base The result of the matching between the context and the rule base is true if the whitelist is satisfied, and false if the blacklist is triggered.
[0043] When allow=true and R∈[50,80), rate limiting is automatically triggered. The formula for calculating the allowance ratio is: limit r `ate=max(0.1,1-R / 100)`, while limiting the number of data entries accessed in a single session to ≤10.
[0044] The desensitization strategy described in step S4 is determined by a three-dimensional linkage formula, including desensitization granularity G, desensitization method M, and execution scope E, specifically: Desensitization particle size: G=min(1,G base ×(1+R / 100)×(1−Auth(identity)); Among them, G base The basic desensitization granularity corresponds to the sensitivity level S: non-sensitive = 0, internally sensitive = 0.3, highly sensitive = 0.7, and top secret = 1.
[0045] The desensitization method M is selected using the fit score formula: Score(Mk) = W s ×S suit (M k ,S)+W r ×R suit (M k ,R)+W a ×A suit (M k ,Auth), M final =argmax k Score(M k ), where W s +W r +W a =1;S suit To assess the adaptability of desensitization methods to sensitivity levels, R suit To adapt to risk levels, A suit To ensure adaptability to identity permissions, all three values are [0,1]. The desensitization execution range is E=min(2,Ebase ×(1+R / 50)), where E base =1, when R≥50, expand to the associated sensitive fields, when R≥80, E=2 (execute on all fields).
[0046] Through the above desensitization strategies, the sensitivity levels of information are finely divided, and different desensitization methods are flexibly and securely implemented for different scenarios, meeting the differentiated and refined protection needs under different permissions and risk scenarios.
[0047] S5. Based on the end-to-end context lossless pass-through mechanism, a globally unique TraceID is generated as the context identifier. Dynamic hash verification is used to prevent context tampering. Access control results, desensitization policies and context information are synchronized to all nodes in the distributed architecture to ensure the consistency of decisions of each node and prevent context loss or tampering. The end-to-end context lossless pass-through mechanism described in step S5 specifically includes: TraceID = Hex(MD5(IP+Timestamp+UUID+ThreadID)), where IP is the application instance IP address, Timestamp is the millisecond-level timestamp of the request arrival, UUID is a 128-bit random UUID, ThreadID is the request processing thread ID, Hex() is the hexadecimal encoding function, and MD5 is the hash function. The formula for preventing context tampering through hash verification is H=SHA256(Serialize(Context)+TraceID+Salt), where H is the context verification hash value, Serialize() is the normalized serialization function for context information, SHA256() is the secure hash algorithm 256 function, Serialize(Context) is the serialized string of context information, and Salt is a dynamic salt value bound to the application instance and timestamp, which is updated every minute. The cross-thread / cross-service pass-through formula is Context. child =Context parent ×I(TraceID child ==TraceID parent When the TraceID matches, the child thread / downstream service fully inherits the parent context; otherwise, it is reinitialized.
[0048] S6. Monitor system performance metrics in real time, including the percentage increase in business response time, CPU utilization, memory usage, and business anomaly rate. When system performance metrics trigger preset degradation thresholds, execute level 1, 2, or 3 graded degradation strategies to ensure uninterrupted business operation. When system performance recovers, use a gradient recovery algorithm to smoothly restore system functionality and avoid system jitter.
[0049] The tiered degradation strategy described in step S6 includes: Define the system performance metric set Metrics=[rt ratio CPU usage mem usage error rate These correspond to the percentage increase in business response time, CPU utilization, memory usage, and business anomaly rate, respectively; the downgrade level is calculated as Level=max{k|Metrics}. k ≥Threshold k}, k∈[1,2,3], where the first-level degradation trigger condition is that the business response time increases by more than 50% or the AI inference time is ≥10ms, the second-level degradation trigger condition is that the CPU utilization rate is ≥80% or the component memory usage exceeds the preset threshold, and the third-level degradation trigger condition is that the business anomaly rate is ≥10%; The component function execution weight W corresponds to different degradation levels func During Level 1 degradation, the AI model is set to 0.3, non-core links to 0, and core modules to 1; during Level 2 degradation, the AI model is set to 0, dynamic risk assessment to 0, and core rules to 1; during Level 3 degradation, all modules are set to 0 (bypass mode). The bypass mode means that all security modules are completely bypassed and do not intervene in the execution of business logic, ensuring the native operation of the business. The gradient recovery algorithm is adopted, and the recovery trigger condition is that the duration of the system index T is less than or equal to Threshold. k−1 The weight update formula is W func (t+1)=min(1,W func (t)+β), where β is the gradient recovery step size, updated every 10 seconds, supporting step-by-step recovery.
[0050] Existing technologies typically rely on single regular expression rules for sensitive data identification, resulting in low accuracy and weak ability to identify unstructured and novel sensitive data. This leads to frequent false positives and false negatives, and the inability to quantify and classify sensitivity levels. Consequently, de-identification strategies either over-identify, impacting business operations, or under-identify, causing data leaks. Furthermore, decision-making logic is disconnected; access control and sensitive data de-identification are often independent modules, failing to achieve deep linkage between risk levels, sensitivity levels, and decision-making strategies. This prevents dynamic adjustments to de-identification strategies and access permissions based on real-time risks, failing to balance security protection with business convenience. Finally, poor end-to-end consistency is a significant issue, hindering the development of distributed microservices. In this service architecture, context information is easily lost or tampered with during cross-thread and cross-service transmission, leading to inconsistent security decisions between upstream and downstream nodes. This results in issues such as "upstream allows, downstream rejects" or inconsistent de-identification strategies, undermining the overall integrity of security protection. Business and security conflicts exist, and existing degradation strategies often simply shut down security functions without implementing tiered degradation, which can easily lead to business interruptions. Only the decoupling logic for de-identification is implemented, without considering business continuity assurance in scenarios with abnormal performance, and without implementing full-link access control and de-identification linkage. At the same time, complex security algorithms can easily consume too many system resources and cannot adapt to the lightweight deployment requirements of the Java runtime.
[0051] The method provided in this invention generates a context feature vector in a unified format, outputs risk level and sensitivity level based on the context feature vector, executes a dual decision logic of access control and desensitization strategy based on the risk level and sensitivity level, and outputs access control results and sensitive data desensitization strategy; it ensures the consistency of decisions of each node based on the end-to-end context lossless pass-through mechanism to prevent context loss or tampering; and it monitors system performance indicators in real time to avoid system jitter, thus comprehensively and systematically solving the above-mentioned technical problems existing in the prior art.
[0052] Example 2 like Figure 4 As shown, Embodiment 2 of the present invention provides a non-intrusive AI-enhanced dynamic access control and sensitive data protection system, used to implement the non-intrusive AI-enhanced dynamic access control and sensitive data protection method described in Embodiment 1, including a business application cluster, a bytecode enhancement layer, and a core functional module layer.
[0053] The bytecode enhancement layer includes a non-intrusive aspect implantation module, which is used to dynamically load the Java application at startup via the Java Agent, implant non-intrusive aspects and pointcuts into the core nodes of the entire Java application chain, achieve zero intrusion into business code, and provide a carrier for data collection and strategy execution for other modules.
[0054] The core functional module layer specifically includes: The context acquisition and preprocessing module is used to receive user access requests, acquire multi-dimensional context information through non-intrusive aspect cutpoints, complete data preprocessing, and generate context feature vectors. The dynamic risk assessment module is used to execute dynamic risk assessment algorithms, integrate multi-dimensional risk factors, and output dynamic risk scores and corresponding risk levels. The sensitive data identification module is used to execute the intelligent sensitive data identification algorithm. It uses a combination of regular expressions and AI models to identify sensitive data, adapts to new types of sensitive data through zero-shot learning, and outputs the sensitivity level judgment result. The dynamic policy execution engine module is used to execute dual decision logic for access control and de-identification policies, and outputs access control results and sensitive data de-identification policies. The end-to-end context pass-through and verification module is used to perform lossless pass-through and consistency verification mechanisms to ensure end-to-end decision consistency. The performance monitoring and degradation recovery module is used to execute tiered degradation and gradient recovery strategies to ensure uninterrupted business operation. The audit log storage module is used to store context data, risk baselines, sensitive rules, policy configurations, and audit logs. The context acquisition and preprocessing module, dynamic risk assessment module, sensitive data identification module, dynamic policy execution engine module, end-to-end context pass-through and verification module, and performance monitoring and degradation recovery module complete data interaction and policy execution through the non-intrusive aspect insertion point of the non-intrusive aspect implantation module, forming a closed loop of end-to-end security protection.
[0055] System Implementation Environment Description: This third embodiment is applicable to Java applications with JDK 8 and above, adapts to Spring Cloud and Spring Boot microservice architectures, supports mainstream RPC frameworks such as Dubbo and Feign, and is compatible with mainstream data access frameworks such as MyBatis and JPA. Based on the ByteBuddy bytecode enhancement framework, it realizes non-intrusive aspect-pointer injection of Java Agent, without modifying any source code of the business application. Deployment can be completed simply by adding the -javaagent parameter to the Java application startup command.
[0056] Detailed Explanation of the Core Implementation Steps of the System: 1. Non-intrusive deployment and context collection of Java Agent.
[0057] Package the Java Agent program, including aspect definitions, bytecode enhancement logic, and core functional modules; When the target Java application starts, the Agent program is loaded via the startup parameter -javaagent:xxx-security-agent.jar. The Agent performs bytecode enhancement during the application startup phase, injecting non-intrusive aspect-pointers at the following core nodes: Request entry point: The Controller layer of Spring MVC, used to collect the entry context information of user requests; Cross-service call pointcut: Dubbo / Feign consumer and provider sides, used for cross-service context pass-through; Cross-thread execution pointcuts: JDK thread pools and Spring asynchronous methods, used for cross-thread context passing; Data return point of view: MyBatis' ResultSet result set processing and response body serialization stage, used for the execution of de-identification strategies; By embedding non-intrusive aspect ratios and cutters, the system collects full-dimensional contextual information about user access requests, including: identity information (user account, role, permission level, department); device information (device fingerprint, terminal type, operating system, trusted status, login IP); geolocation information (login location, frequently used location, whether cross-border / cross-regional access); access behavior information (access frequency, access time, access resource range, historical operation records); and access resource information (interface address, data type, data content, data volume).
[0058] 2. Context preprocessing.
[0059] The following preprocessing operations are performed on the collected raw context information: Data cleaning: Remove null values, duplicate values, and outlier data that are outside the reasonable range; Data standardization: Discrete features (such as device type and region) are one-hot encoded, and continuous features (such as access frequency and data volume) are min-max normalized and mapped to the [0,1] interval; Feature engineering: Extract high-order combined features, generate context feature vectors in a unified format, and input them into the subsequent dual-core analysis module.
[0060] 3. Dual-core parallel analysis. Utilizing multi-threaded parallel execution for dynamic risk assessment and sensitive data identification improves processing efficiency and reduces business response latency.
[0061] 3.1 Context awareness and dynamic risk assessment.
[0062] By integrating five core risk factors, a dynamic risk score is calculated collaboratively using three algorithms: Multi-factor weighted basic score calculation: The basic risk score is calculated using a formula, with the default weight configurations for the five major risk factors as follows: identity and permission abnormality w1=0.25, device trust abnormality w2=0.2, geographical location abnormality w3=0.15, access behavior abnormality w4=0.25, and resource sensitivity abnormality w5=0.15. The weights can be hot-updated through the configuration center without restarting the application. User behavior baseline deviation analysis based on sliding window: default time window T=5 minutes, sliding step Δt=1 minute, calculate the deviation between real-time user behavior and historical baseline, as the core input of access behavior anomaly factor F4; Lightweight incremental isolated forest anomaly identification: Anomaly scores are calculated using a formula, with a default number of trees ψ=100 and a maximum depth of 8 per tree; training samples are constructed by a 1:1 mixture of normal access behavior and labeled abnormal behavior, and incremental pruning and retraining are performed daily at midnight based on the newly labeled data from the previous day. The pruning rule is to remove invalid trees with a path length variance of less than 0.1; the anomaly scores of the access samples are output, and the multi-factor weighted results are verified a second time. Risk level mapping: The risk level is mapped according to the final risk score R. R<30 is low risk, 30≤R<50 is medium risk, 50≤R<80 is high risk, and R≥80 is extremely high risk.
[0063] 3.2 AI-enhanced intelligent identification and classification of sensitive data.
[0064] Implementation details of the lightweight BiLSTM+CRF sequence labeling model: The model adopts a 1-layer forward + 1-layer backward LSTM structure, with a hidden layer dimension of 64 and a word embedding dimension of 128; the pre-training dataset covers 17 common sensitive data categories such as ID card numbers, mobile phone numbers, bank card numbers, addresses, and trade secrets, with a total of 500,000 labeled samples; the training phase uses the Adam optimizer with a learning rate of 0.001, a batch size of 32, and 50 iteration rounds; the inference phase uses INT8 quantization compression to reduce memory usage and inference time; the model completes the boundary and type identification of sensitive entities through a process, and selects high-confidence results with Conf≥0.85; Model and regularized fusion decision: Formulas are used to complete the fusion decision to avoid missed and false judgments; Zero-shot learning to adapt to new sensitive data: Based on a general Chinese pre-trained word vector model, the cosine similarity between the sensitive entity description text and the text to be identified is matched. When the similarity threshold is ≥0.75, it is determined to be the corresponding sensitive type, without the need to retrain the model; Sensitivity level quantification: The comprehensive score of sensitivity level is calculated using a formula. The default mapping rule is: S<0.2 is non-sensitive, 0.2≤S<0.4 is internally sensitive, 0.4≤S<0.8 is highly sensitive, and S≥0.8 is top secret. This provides a precise basis for subsequent desensitization strategies.
[0065] 4. Dynamic strategy engine with dual decision linkage.
[0066] The dynamic policy engine executes access control decisions and de-identification policy decisions simultaneously, achieving deep linkage between risk, sensitivity level, and identity permissions: Access control decision: A formula is used to determine whether to allow access requests. The default device trust threshold Tmin=0.3 and the access denial threshold Rdeny=80. When the judgment result is to allow access and R∈[50,80) is a high-risk range, rate limiting is automatically triggered, the allowance ratio is calculated according to the formula, and the number of data accesses per time is limited to ≤10. When R≥80 is an extremely high risk, access is directly denied. Desensitization strategy decision: A three-dimensional linkage formula is used to determine the final desensitization strategy, with the default weight configuration being Ws=0.5, Wr=0.3, Wa=0.2; Desensitization granularity: The higher the risk and the lower the user's access level, the coarser the desensitization granularity. For example, for top-secret data, high-risk users, and low-access users, full mask desensitization should be performed. De-identification methods: The optimal solution is selected based on the fit score, supporting multiple de-identification methods such as masking, replacement, encryption, truncation, and hashing. For example, ID number adaptation mask de-identification and key data adaptation encryption de-identification are used. Scope of execution: The higher the risk, the wider the scope of desensitization. In high-risk scenarios, associated sensitive fields are automatically covered, and in extremely high-risk scenarios, all fields are desensitized.
[0067] 5. Lossless transparent transmission of the entire link context.
[0068] TraceID generation: When a request reaches the entry point, a globally unique TraceID is generated as a unique identifier for the entire request chain; Context hash verification: SHA256 hash calculation is performed on the context information. The dynamic salt value is updated every minute. The hash value is recalculated at each cut point in the entire link and compared with the transparent hash value. If they are inconsistent, an alarm is triggered and the complete context of the upstream node is reused to prevent context tampering. Cross-node pass-through: In cross-thread scenarios, the parent-child thread passing of context is achieved through a thread pool wrapper class; in cross-service scenarios, the TraceID and serialized context information are carried in the RPC request header. After the downstream service verifies that the TraceID is consistent, it fully inherits the parent context, ensuring that all nodes in the entire chain use the same set of context information to perform security decisions and avoid inconsistency issues.
[0069] 6. System performance monitoring and graded degradation recovery.
[0070] Real-time monitoring: Collects core performance indicators such as business response time, CPU utilization, memory usage, business anomaly rate, and AI inference time. The default collection frequency is 1 second / time. Tiered degradation: Determine the degradation level based on the triggered threshold and execute the corresponding degradation strategy; Level 1 Degradation: Only core rule verification is retained, the inference frequency of AI models is reduced, audit logs for non-core links are turned off, and the response speed of core businesses is guaranteed; Level 2 Degradation: Disable AI models and dynamic risk assessments, and only perform core regular expression sensitive identification and blacklist / whitelist access control to minimize resource consumption; Level 3 Degradation: All security modules enter bypass mode, which does not affect the operation of business logic at all and ensures business continuity; Gradient recovery: When the system metric remains below the threshold of the previous level for 30 seconds, gradient recovery is initiated. The default step size β=0.2. The component function weight is increased every 10 seconds, gradually restoring to full functionality to avoid system jitter caused by full functionality.
[0071] The non-intrusive AI-enhanced dynamic access control and sensitive data protection system of Embodiment 2 of the present invention is implemented by executing a computer program in the memory through the processor of a computer server and runs in a Java application server hardware environment, solving the data security technology problem in Java distributed applications.
[0072] Example 3 Embodiment 3 of the present invention is a specific application example of the non-intrusive AI-enhanced dynamic access control and sensitive data protection system described in Embodiment 2 in a Java distributed credit system in the financial industry.
[0073] Deployment method: Add the -javaagent parameter to the Java startup command of the gateway service, user service, credit service and loan disbursement service of the credit system to complete non-intrusive deployment without modifying any business code, and complete the full cluster deployment and go online within one hour; Configuration Adaptation: In response to the regulatory requirements of the financial industry, data such as ID card numbers, bank card numbers, and credit reports are defined as top secret / highly sensitive data, and corresponding desensitization rules are configured; the device trust threshold Tmin=0.5 and the access denial threshold Rdeny=70 are set to adapt to the high security requirements of the financial industry; Operational Results: When users access credit data outside of working hours or at infrequently used locations, the system calculates a dynamic risk score R=75, triggering high-risk flow restriction with a 25% approval rate. Simultaneously, top-secret data in the credit report is fully masked and anonymized, with only high-privilege account managers having access to some plaintext data. When the system's CPU usage reaches 82% during peak periods, a secondary degradation is automatically triggered, disabling AI model inference and only executing strong regularization rules and blacklist / whitelist controls from financial regulators to ensure the normal operation of core lending business. Once system performance recovers, full functionality is smoothly restored.
[0074] In the embodiments of the present invention, all technical features not described in detail are existing technologies or conventional technical means, and will not be repeated here.
[0075] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit them. The scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions 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 invention, and should all be covered within the scope of protection of the present invention.
Claims
1. A non-intrusive AI-enhanced dynamic access control and sensitive data protection method, characterized in that, Includes the following steps: S1. Based on the Java Agent, dynamic loading is completed when the target Java application starts. Non-intrusive aspects and pointcuts are implanted in the core nodes of the entire Java application chain to receive user access requests and collect user access context information through non-intrusive aspects and pointcuts. S2. Preprocess the collected context information, remove invalid and abnormal data, and standardize the data. Convert unstructured information into structured features and generate context feature vectors in a unified format. S3. Based on context feature vectors, perform context awareness and dynamic risk assessment to output risk level, and use AI to enhance intelligent identification of sensitive data to output sensitivity level; S4. Based on risk level and sensitivity level, execute dual decision logic for access control and de-identification strategy, and output access control results and sensitive data de-identification strategy simultaneously. S5. Based on the end-to-end context lossless pass-through mechanism, a globally unique TraceID is generated as the context identifier. Dynamic hash verification is used to prevent context tampering. Access control results, desensitization policies and context information are synchronized to all nodes in the distributed architecture to ensure the consistency of decisions of each node and prevent context loss or tampering. S6. Monitor system performance indicators in real time. When system performance indicators trigger preset degradation thresholds, execute level 1, level 2, or level 3 degradation strategies to ensure uninterrupted business operation. When system performance recovers, smoothly restore system functions through gradient recovery algorithms to avoid system jitter.
2. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 1, characterized in that, In S3, the specific steps for performing context-aware and dynamic risk assessment include: integrating five core risk factors—identity and permission anomalies, device trust anomalies, geographical location anomalies, access behavior anomalies, and resource sensitivity anomalies—and employing three algorithms—multi-factor weighted quantization, user behavior baseline deviation analysis based on sliding windows, and lightweight incremental isolated forest anomaly identification—to collaboratively calculate dynamic risk scores and map them to four risk levels: low, medium, high, and extremely high. The specific steps for AI-enhanced intelligent identification of sensitive data include: using a fusion of regularization rules and a lightweight BiLSTM+CRF sequence labeling model to identify sensitive data in accessed resources; adapting to new types of sensitive data through zero-shot learning; and simultaneously using quantification formulas to determine the sensitivity level of sensitive data, mapping it to four levels: non-sensitive, internally sensitive, highly sensitive, and top secret.
3. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 2, characterized in that, The steps for analyzing user behavior baseline deviation based on a sliding window are as follows: define the time window and sliding step size, collect user behavior statistical vectors within the window, calculate the historical baseline vectors for the same time period over the past 30 days, and calculate the behavior deviation using L2 Euclidean distance; Isolation forest supports daily incremental pruning and retraining based on labeled samples.
4. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 2, characterized in that, The lightweight BiLSTM+CRF sequence labeling model includes: word embedding of the input text sequence; extraction of contextual features through forward LSTM and backward LSTM to obtain the final feature vector; calculation of the global score of the label sequence through the CRF layer; solving for the optimal label sequence using the Viterbi algorithm to obtain the boundary and type of sensitive entities; and calculation of entity confidence. It also includes zero-shot learning to adapt to novel sensitive data, specifically: based on a pre-trained Chinese word vector model, calculating the cosine similarity between the text to be identified and the descriptive text of the novel sensitive data; when the cosine similarity is ≥ a preset threshold, it is determined to be the corresponding sensitive entity, without needing to retrain the AI model.
5. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 1, characterized in that, In S4, access control results are determined by a Boolean decision function to allow or deny access, and rate limiting is automatically triggered in high-risk scenarios. The desensitization strategy is determined by a three-dimensional linkage formula of desensitization granularity, desensitization method, and desensitization execution scope, thereby achieving adaptive desensitization.
6. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 5, characterized in that, The specific steps to achieve adaptive desensitization are as follows: Desensitization granularity G = min(1, G base × (1 + R / 100) × (1 - Auth(identity)), where G base is the base desensitization granularity, corresponding to the sensitivity level S, non-sensitive = 0, internal-sensitive = 0.3, highly-sensitive = 0.7, top-secret = 1; The desensitization method M is selected using the fit score formula: Score(Mk) = W s ×S suit (M k ,S)+W r ×R suit (M k ,R)+W a ×A suit (M k ,Auth), M final =argmax k Score(M k ), where W s +W r +W a =1;S suit To assess the adaptability of desensitization methods to sensitivity levels, R suit To adapt to risk levels, A suit To ensure adaptability to identity permissions, all three values are [0,1]. Desensitization execution range E=min(2,E) base ×(1+R / 50)), where E base =1, when R≥50, expand to the associated sensitive fields, when R≥80, E=2 (execute on all fields).
7. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 1, characterized in that, In S5, the end-to-end context lossless pass-through mechanism specifically includes: TraceID = Hex(MD5(IP+Timestamp+UUID+ThreadID)), where IP is the application instance IP address, Timestamp is the millisecond-level timestamp of the request arrival, UUID is a 128-bit random UUID, ThreadID is the request processing thread ID, Hex() is the hexadecimal encoding function, and MD5 is the hash function. The formula for preventing context tampering through hash verification is H=SHA256(Serialize(Context)+TraceID+Salt), where H is the context verification hash value, Serialize() is the normalized serialization function for context information, SHA256() is the secure hash algorithm 256 function, Serialize(Context) is the serialized string of context information, and Salt is a dynamic salt value bound to the application instance and timestamp, which is updated every minute. The cross-thread / cross-service pass-through formula is Context. child =Context parent ×I(TraceID child ==TraceID parent When the TraceID matches, the child thread / downstream service fully inherits the parent context; otherwise, it is reinitialized.
8. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 1, characterized in that, In S1, the core node includes at least a request entry point, a cross-service call node, a cross-thread execution node, and a data return node, and the context information includes at least identity information, device information, geographical location information, access behavior information, and access resource information.
9. The non-intrusive AI-enhanced dynamic access control and sensitive data protection method according to claim 1, characterized in that, In S6, system performance metrics include the percentage increase in service response time, CPU utilization, memory usage, and service anomaly rate.
10. A non-intrusive AI-enhanced dynamic access control and sensitive data protection method, characterized in that, The method for implementing the non-intrusive AI-enhanced dynamic access control and sensitive data protection method of claim 1 includes: The non-intrusive aspect implantation module is used to dynamically load non-intrusive aspects and pointcuts through the Java Agent when the Java application starts, and to implant non-intrusive aspects and pointcuts into the core nodes of the entire Java application chain, so as to achieve zero intrusion of business code and provide a carrier for data collection and strategy execution for other modules. The context acquisition and preprocessing module is used to acquire multi-dimensional context information through non-intrusive face and cutpoint, complete data preprocessing, and generate context feature vectors. The dynamic risk assessment module is used to integrate multi-dimensional risk factors and output dynamic risk scores and corresponding risk levels. The sensitive data identification module is used to identify sensitive data by fusing regular expressions and AI models. It adapts to new types of sensitive data through zero-shot learning and outputs the sensitivity level judgment result. The dynamic policy execution engine module is used to execute dual decision logic for access control and de-identification policies, and outputs access control results and sensitive data de-identification policies. The end-to-end context pass-through and verification module is used to perform lossless pass-through and consistency verification mechanisms to ensure end-to-end decision consistency. The performance monitoring and degradation recovery module is used to execute tiered degradation and gradient recovery strategies to ensure uninterrupted business operation. The context acquisition and preprocessing module, dynamic risk assessment module, sensitive data identification module, dynamic policy execution engine module, end-to-end context pass-through and verification module, and performance monitoring and degradation recovery module complete data interaction and policy execution through the non-intrusive aspect insertion point of the non-intrusive aspect implantation module, forming a closed loop of end-to-end security protection.