A RASP-based method and related equipment for handling user access behavior
By combining RASP dynamic injection and the LightGBM model with Bloom Filter and PhantomReference to optimize resources, the performance bottlenecks and insufficient accuracy of traditional security protection technologies have been solved, enabling real-time detection and supervision of high-risk data and ensuring data security and compliance.
Patent Information
- Application Number
- CN202611282077.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-10
AI Technical Summary
Traditional security protection technologies require system downtime for deployment when identifying high-risk data, cannot parse encrypted traffic, consume high resources, rely on single features leading to low identification accuracy and high false alarm rate, lack real-time interception mechanisms, and are difficult to meet the requirements of high-concurrency scenarios and compliance.
Using RASP dynamic injection technology, non-intrusive real-time behavior detection is achieved through the JVM-TI tool interface and ASM framework. Composite feature vectors are constructed and the LightGBM model is trained. Bloom Filter and PhantomReference are combined to optimize resources and monitor high-risk behaviors in real time.
It enables real-time detection and monitoring of high-risk data, reduces CPU usage, improves recognition accuracy, meets the needs of high-concurrency scenarios, reduces false alarm rate, supports dual-person mutual supervision and approval, and ensures data security.
Smart Images

Figure CN123074792A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network security technology, and in particular to a user access behavior processing method and related equipment based on RASP. Background Technology
[0002] With the acceleration of digital transformation, business systems in industries such as finance and telecommunications carry massive amounts of sensitive customer data (such as SMS messages, location information, identity information, etc.). However, the frequent occurrence of black market activities and telecommunications fraud, data theft and sale have led to increasingly serious problems such as privacy leaks and property losses. Traditional security protection is no longer able to meet the needs of high-risk data full lifecycle management.
[0003] Currently, the shortcomings of technologies for identifying high-risk data include: some technologies require downtime deployment of business systems when identifying high-risk data, cannot parse encrypted traffic such as HTTPS / TLS 1.3, and consume excessive resources (e.g., CPU utilization > 50%), making them unsuitable for high-concurrency scenarios with QPS of 10,000, thus exhibiting problems such as strong invasiveness and low performance; some technologies rely on single features such as IP address and operation frequency, resulting in low F1 scores (< 0.75), high false positive rates (> 12%), and a lack of visualization capabilities for feature importance, failing to meet the audit requirements of regulations such as GDPR, thus exhibiting problems such as insufficient accuracy and compliance of single-feature models; some technologies lack real-time interception mechanisms, have long approval process response times (> 1 minute), rely solely on single-point verification, and are easily exploited by malicious users to abnormally obtain sensitive data through business logic vulnerabilities, thus exhibiting problems such as lagging high-risk operation control and weak security. Summary of the Invention
[0004] To address at least one of the aforementioned technical problems, the present invention aims to provide a user access behavior processing method and related equipment based on RASP.
[0005] On one hand, embodiments of the present invention include a RASP-based user access behavior processing method, the RASP-based user access behavior processing method comprising: By dynamically injecting RASP, non-intrusive real-time behavior detection is performed to detect user access behavior. Perform runtime data risk detection on the user access behavior; When the detection determines that the user's access behavior is high-risk, real-time monitoring of the user's access behavior is performed.
[0006] Furthermore, the method of performing non-intrusive real-time behavior detection through RASP dynamic injection to detect user access behavior includes: The Agent hot-loading mechanism is implemented by loading the JVM-TI tool interface, and behavior detection code is injected during the loading process of the business class through the JVM-TI tool interface; The ASM framework is used to detect the number of method calls. When the number of method calls exceeds a preset threshold, the behavior detection code is injected to detect the user's access behavior. Run the Bloom Filter to filter detection requests and reclaim resources using PhantomReference.
[0007] Furthermore, the runtime data risk detection performed on the user access behavior includes: Based on the user access behavior, a composite feature engineering is constructed to obtain a multi-dimensional feature vector. Training the LightGBM model; Deploy the LightGBM model, input the multidimensional feature vector into the LightGBM model for processing, and obtain the risk detection result output by the LightGBM model.
[0008] Furthermore, the step of constructing a composite feature engineering based on the user access behavior to obtain a multi-dimensional feature vector includes: Extract the time-series features and IP geographic migration path features of the user access behavior; The multidimensional feature vector is constructed based on the time series features and the IP geographical migration path features.
[0009] Further, constructing the multidimensional feature vector based on the time series features and the IP geographic migration path features includes: Based on the time series characteristics, extract the average user login time period and the 24-hour operation frequency; Based on the IP geographical migration path characteristics, calculate the total IP migration distance and the number of regional changes; Obtain the GDPR sensitivity level of the user's access behavior; The multidimensional feature vector is composed of the average user login time period, the 24-hour operation frequency, the total distance of IP migration, the number of regional changes, and the GDPR sensitivity level.
[0010] Furthermore, the training of the LightGBM model includes: Set the dynamic tree depth; Based on the dynamic tree depth, the LightGBM model is trained as a binary classification model; The TreeExplainer was used to calculate the SHARP value for each feature output by the LightGBM model. Interpret the decision results of the LightGBM model based on the SHARP value.
[0011] Furthermore, deploying the LightGBM model includes: A lightweight model package of the LightGBM model is generated using model compression technology; The LightGBM model is loaded into the business system using the RASP Agent.
[0012] Furthermore, the real-time monitoring of the user's access behavior includes: Initiate the supervision and approval process from higher authorities; Build a view of oversight content and approval processes; The supervision content and the approval view are sent to the superior, requesting the superior to perform the approval.
[0013] On the other hand, embodiments of the present invention also include a computer device, including a memory and a processor, the memory for storing at least one program, and the processor for loading at least one program to execute the RASP-based user access behavior processing method in the embodiments.
[0014] On the other hand, embodiments of the present invention also include a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the RASP-based user access behavior processing method in the embodiments.
[0015] The beneficial effects of this invention are as follows: The RASP-based user access behavior processing method in the embodiments achieves closed-loop control of the entire process of "detection-identification-supervision" of high-risk data through three major technologies: non-intrusive dynamic protection, runtime data risk detection, and real-time supervision and approval. This effectively solves the problems of performance bottlenecks, insufficient accuracy, and lagging control of traditional technologies, thereby realizing real-time identification and control of high-risk data operations, effectively preventing data leakage and abuse, and protecting customer privacy and business system security. Attached Figure Description
[0016] Figure 1 This is a schematic diagram illustrating the steps of the RASP-based user access behavior processing method in the embodiment. Figure 2 This is a schematic diagram illustrating the principle of the RASP-based user access behavior processing method in this embodiment. Figure 3 This is a schematic diagram illustrating the principle of steps S101-S103 in the embodiment; Figure 4 This is a schematic diagram illustrating the principle of steps S201-S203 in the embodiment; Figure 5This is a schematic diagram illustrating the principle of steps S301-S303 in the embodiment; Figure 6 This is a schematic diagram of the computer device in the embodiment. Detailed Implementation
[0017] Terminology Explanation: RASP: Runtime Application Self-Protection, is a security technology embedded within an application. It monitors and protects the application from within its own runtime process (such as JVM, .NET CLR, Node.js), observing behavior like function calls, database queries, and file access through bytecode instrumentation. Combined with application context, it identifies and blocks attacks such as SQL injection, XSS, command injection, and XXE in real time. The difference between RASP and WAF (Web Application Firewall) is that WAF only observes request / response traffic from the application's perspective, while RASP observes code-level behavior within the application, possessing a complete application execution context, thus resulting in a lower false positive rate. JVM-TI (Java Virtual Machine Tool Interface) is a native C / C++ programming interface introduced in JDK 5.0. It provides a way to inspect and control the state of applications running in the JVM, supporting a wide range of tools, including performance profiling, debugging, monitoring, thread analysis, and coverage analysis. JVM-TI replaced the earlier JVMPI (JVM Profiler Interface) and JVMDI (JVM Debug Interface). JDWP (Java Debug Wire Protocol) and the java.lang.instrument package are built upon it. Bloom Filter: A probabilistic, space-efficient data structure proposed by Burton Howard Bloom in 1970. It can be used for checking the existence of set members. Its working principle is as follows: it consists of an m-bit array and k independent hash functions. When inserting an element, the k hash functions are used to calculate k positions and set the corresponding bits to 1. Similarly, when querying, the k positions are calculated. If all bits are 1, then the element is considered to be in the set; if any bit is 0, then the element is not considered to be in the set. The core characteristic of a Bloom Filter is that it never produces false negatives, but it may produce false positives (the probability of false positives can be tuned by adjusting m and k). PhantomReference: A phantom reference, the most unique of Java's four reference types (strong, soft, weak, and phantom). Its characteristics are: the `get()` method always returns null, making it impossible to retrieve the referenced object; when the garbage collector determines that the object is "phantom reachable" and should be reclaimed, it atomically clears all phantom references pointing to it and enqueues these references (to a ReferenceQueue); PhantomReference can be used to schedule post-mortem cleanup actions after an object is reclaimed, offering a more flexible alternative to the `finalize()` mechanism; the difference between PhantomReference and weak references is that phantom references are only enqueued when the object is actually about to be reclaimed, while weak references may be enqueued when the object loses its strong reference chain, even if the object is "resurrected" by `finalize()`—therefore, only phantom references can accurately track the object's reclamation status.
[0018] LightGBM: Light Gradient Boosting Machine, a high-performance gradient boosting tree (GBDT) framework optimized for large-scale data and high-performance training. Its core features include: faster training speed and lower memory usage to support parallel, distributed and GPU acceleration; use a leaf-wise growth strategy instead of the traditional layer-wise growth strategy; and introduce two key technologies: GOSS (Gradient-based one-sided sampling) and EFB (mutually exclusive feature binding). It can be used for classification, regression and ranking tasks, and is especially suitable for large-scale tabular data and competitive scenarios. TreeExplainer: An interpreter class in the SHAP (SHapley Additive exPlanations) Python package that uses the Tree SHAP algorithm to interpret the output of ensemble tree models. TreeSHAP is a fast and accurate algorithm for estimating the SHAP values of tree models and their ensemble models under several different feature dependency assumptions. Supported models include XGBoost, LightGBM, CatBoost, PySpark, and most tree-based scikit-learn models. TreeExplainer can accurately compute SHAP values.
[0019] To address the challenges of identifying high-risk data, such as high invasiveness, low performance, insufficient accuracy and compliance of single-feature models, lagging high-risk operation control, and weak security, a dual-person mutual supervision operation solution for high-risk data based on RASP can be implemented. This solution utilizes three key technologies: non-intrusive dynamic protection, spatiotemporal-sensitivity level composite feature recognition, and real-time dual-person mutual supervision and approval. This achieves closed-loop control of the entire process of "detection-identification-supervision" for high-risk data, effectively solving the performance bottlenecks, insufficient accuracy, and lagging control issues of traditional technologies, and ensuring customer privacy and business system security.
[0020] Based on the above principles, this embodiment provides a user access behavior processing method based on RASP. (Refer to...) Figure 1 The RASP-based user access behavior processing method includes the following steps: S1. By dynamically injecting RASP, non-intrusive real-time behavior detection is performed to detect user access behavior; S2. Perform runtime data risk detection on user access behavior; S3. When the detection determines that a user's access behavior is high-risk, real-time monitoring of the user's access behavior is performed.
[0021] In this embodiment, the principle of steps S1-S3 is as follows: Figure 2 As shown. (Refer to...) Figure 2 In this embodiment, the RASP-based user access behavior processing method implements a high-risk data dual-person mutual supervision operation scheme by executing steps S1-S3. This scheme utilizes three technologies—RASP, high-risk data identification technology, and dual-person mutual supervision operation technology—to achieve three models: non-intrusive real-time detection capability, high-precision low-latency high-risk data identification capability, and real-time supervision of high-risk behavior, respectively. Specifically, the non-intrusive real-time detection capability achieves real-time behavior monitoring with zero modification to the business system through RASP dynamic injection technology; the high-precision low-latency high-risk data identification technology is a runtime data risk detection mechanism based on an improved decision tree model; and the real-time mutual supervision automatically initiates an approval process once high-risk data is identified in a user's access behavior, requiring approval from a superior user before continued access; otherwise, access is denied.
[0022] Specifically, the non-intrusive real-time detection implemented in step S1 is a lightweight runtime protection mechanism based on the JVM-TI interface, built around RASP dynamic injection technology, and achieves non-intrusive security enhancement of the business system through a dynamic proxy pattern. It employs the ASM framework for bytecode-level operations to construct an adaptive injection strategy based on method call frequency. Compared to traditional RASP static Hook injection, this proposal has more accurate high-risk data identification and coverage capabilities and more controllable resource consumption.
[0023] In step S1, RASP dynamic injection is implemented through the following three levels: Dynamic loading layer: Implements agent hot loading through the JVM-TI tool interface, triggering bytecode modification process when business class is loaded; Intelligent injection layer: The ASM framework is used to parse the class file structure and dynamically select the injection point based on the method call frequency threshold to generate a detection code package of <50KB; Resource optimization layer: Bloom Filter is introduced for fast request filtering, and PhantomReference is used to realize automatic resource reclamation, thereby reducing CPU utilization; The RASP dynamic injection implemented in step S1 breaks through the limitations of traditional RASP solutions in handling encrypted traffic. First, it establishes a real-time detection channel for user access behavior, providing accurate input for subsequent high-risk data identification. Second, it eliminates the need for business system transformation and supports rapid and secure access of microservices in a cloud-native environment. Third, through lightweight design, it reduces the impact of security protection on business performance while ensuring detection efficiency, laying a technical foundation for building real-time supervision and approval processes.
[0024] By executing step S1 to achieve dynamic injection based on RASP, it is possible to detect the behavior of each user accessing the business system in real time, thereby laying a technical foundation for further real-time identification of whether the data in the behavior is high-risk data.
[0025] The high-precision, low-latency high-risk data identification achieved in step S2 is a runtime data risk detection mechanism based on an improved decision tree model. By integrating spatiotemporal characteristics of user behavior with data sensitivity levels through composite feature engineering, and combining an interpretable feature selection strategy driven by SHAP values, it achieves efficient and accurate classification of data flowing through the business system, providing a reliable basis for real-time supervision and approval processes.
[0026] In step S2, the real-time identification of high-risk data is achieved through the following steps: constructing a composite feature engineering and intelligent decision-making model. (1) Extract spatiotemporal features such as user operation time series and IP geographical migration path, and construct a three-dimensional feature vector in combination with GDPR data sensitivity level standards; (2) The decision tree model is trained using the LightGBM framework, and the SHAP value calculation module is integrated to quantify the feature contribution. The tree depth (3-8 layers) is dynamically adjusted to balance accuracy and speed. (3) Generate a lightweight model package (<200KB), which is loaded into the business system without the RASP Agent, achieving efficient inference of 5000 times per second.
[0027] The high-risk data real-time identification performed in step S2 reduces the feature dimension by 60% through spatiotemporal feature composite encoding. Combined with SHAP value-driven feature selection, the F1 score is improved to 0.92, which is 18% higher than the traditional model. The model latency is controlled within 80ms to ensure the smoothness of business operations, while reducing the false positive rate from 12% to 3.5%. The visualization of feature importance meets the requirements of financial auditing and provides key technical support for building a real-time risk supervision system.
[0028] In step S3, high-risk behavior refers to user actions containing high-risk data, which are then judged as high-risk behaviors. Once a high-risk behavior is judged, a superior supervision and approval process is triggered. The user must wait for the superior supervision and approval process to be completed. If the approval result is that the operation is allowed, the user can continue to access the service; otherwise, the user's access will be denied.
[0029] The real-time monitoring of high-risk behaviors implemented in step S3 ensures that high-risk data can be monitored by higher authorities when it is accessed, ensuring that high-risk data is used for normal business activities and preventing malicious users from abnormally obtaining high-risk data through business logic.
[0030] In this embodiment, when performing step S1, which is to perform non-intrusive real-time behavior detection through RASP dynamic injection to detect user access behavior, the following steps can be executed: S101. Load the JVM-TI tool interface to implement the Agent hot loading mechanism. Through the JVM-TI tool interface, behavior detection code is injected during the loading process of the business class. S102. Using the ASM framework, the number of method calls is detected. When the number of method calls exceeds a preset threshold, behavior detection code is injected to detect user access behavior. S103. Run the Bloom Filter to filter the detection requests and reclaim resources through PhantomReference.
[0031] The non-intrusive real-time detection capability to be implemented in steps S101-S103 is an application-layer dynamic protection mechanism built on RASP technology. This mechanism achieves non-intrusive bytecode injection through the JVM-TI interface, combined with the fine-grained operation and adaptive injection strategy of the ASM framework, dynamically embedding detection code during business system runtime, and establishing a user behavior monitoring channel covering the entire process. Compared with traditional static Hook solutions, this embodiment achieves breakthrough improvements in encrypted traffic processing, resource consumption control, and deployment convenience, providing high-precision, low-latency raw data support for high-risk data identification.
[0032] Specifically, in this embodiment, as Figure 3As shown, the dynamic loading layer is implemented by executing step S101, the intelligent injection layer is implemented by executing step S102, and the resource optimization layer is implemented by executing step S103.
[0033] Step S101: Implementation of Dynamic Loading Layer In step S101, a dynamic loading layer is implemented by using the JVM-TI tool interface to achieve Agent hot loading mechanism. Specifically, bytecode is dynamically modified during the loading of business classes to build a non-intrusive detection code injection channel, thereby avoiding the need for downtime during data detection.
[0034] In step S101, the implementation of the dynamic loading layer is based on the dynamic bytecode injection mechanism of Java Agent. Specifically, the RaspAgent class serves as the Agent entry point, and a custom RaspClassTransformer class converter is registered during JVM startup via the premain method. RaspClassTransformer intercepts target business classes (such as sensitive modules like payment and login) during the class loading phase, uses the ASM framework to parse the bytecode, and injects security detection logic (such as SQL injection / file upload verification), while ordinary classes are allowed to pass. This non-intrusive design achieves real-time risk interception without modifying business code. Simultaneously, the dynamic loading mechanism supports rapid integration of microservices in cloud-native environments, keeping the detection code package size below 50KB and ensuring business performance degradation is less than 5%.
[0035] In this embodiment, a specific code example of the dynamic loading layer in step S101 is as follows: / / Agent entry class: triggers bytecode modification process public class RaspAgent { public static void premain(String args, Instrumentation inst) { inst.addTransformer(new RaspClassTransformer()); / / Register class converter } } / / Class converter: Intercept the target class and inject detection logic class RaspClassTransformer implements ClassFileTransformer { @Override public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { if (isTargetClass(className)) { / / Determine if it is the target business class return injectDetectionCode(classfileBuffer); / / Perform bytecode injection } return classfileBuffer; / / Return directly if not the target class } } The significance of the dynamic loading layer is to enable zero-modification deployment of business systems. By dynamically injecting detection code through the class loading callback mechanism of JVM-TI, it supports seamless access to microservices in cloud-native environments and eliminates the coupling dependency of traditional solutions on business systems.
[0036] Step S102: Implementation of the smart injection layer In step S102, the ASM framework is used to parse the class file structure to implement the intelligent injection layer. The injection point is dynamically selected based on the method call frequency, and an adaptive lightweight detection code package is built to solve the problems of incomplete coverage and performance overload of traditional static injection.
[0037] In step S102, the intelligent injection layer is specifically implemented through dynamic bytecode injection using the ASM framework, inserting security detection logic during Java method calls. MethodInjectVisitor inherits from MethodVisitor and counts the number of calls (invokeCount increments automatically) while traversing method instructions. When the number of calls exceeds the preset threshold INJECT_THRESHOLD, detection code is injected: the detection point identifier "DETECT_POINT" is loaded via visitLdcInsn, and the static method RiskDetector.isHighRiskData is called for risk verification. This design implements an adaptive injection strategy based on method call frequency, triggering detection only in high-frequency call scenarios, ensuring detection accuracy while keeping the detection code size within 50KB. Finally, super.visitMethodInsn ensures the normal execution of the original method instructions, achieving non-intrusive security enhancement while maintaining the integrity of business logic, providing accurate behavioral feature input for subsequent high-risk data identification.
[0038] In this embodiment, a specific code example of the smart injection layer in step S102 is as follows: The specific code example is as follows: / / ASM bytecode injection: Counting method call frequency and injecting detection logic public class MethodInjectVisitor extends MethodVisitor { private int invokeCount = 0; @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { / / Count the number of times the method is called if (++invokeCount>INJECT_THRESHOLD) { / / Inject detection code when the threshold is exceeded mv.visitLdcInsn("DETECT_POINT"); / / Mark the detection point mv.visitMethodInsn(INVOKESTATIC, "com / security / RiskDetector", / / High-risk data identification class "isHighRiskData", / / High-risk data identification function "(Ljava / lang / String;)V"); } super.visitMethodInsn(opcode, owner, name, desc, itf); } } The significance of the intelligent injection layer is to optimize the selection of injection points by dynamically adjusting the threshold (default 5 times / second) and generate a lightweight detection package of <50KB. While ensuring detection coverage, it keeps the CPU utilization within 70% of the traditional solution, thus achieving a balance between detection efficiency and business performance.
[0039] Step S103: Implementation of the resource optimization layer In step S103, a resource optimization layer is achieved by introducing a Bloom Filter for fast request filtering and combining it with PhantomReference to realize automatic resource reclamation, thereby solving the problems of memory leaks and performance degradation in high-concurrency scenarios.
[0040] In step S103, the resource optimization layer optimizes security detection performance through a dual mechanism. First, the RequestFilter class utilizes a Bloom Filter (expected capacity 1 million, default false positive rate 0.03%) to quickly filter duplicate requests, triggering detection only for unrecorded requestIds, reducing invalid detection overhead by 99.9%. Second, ResourceCleaner inherits from PhantomReference, and when a detected resource is no longer referenced, it automatically triggers the SecurityContext.releaseResources() method through the associated ReferenceQueue, accurately reclaiming memory and detection handles to prevent resource leaks. These two mechanisms work together to achieve a closed-loop "detection-reclaiming" process, maintaining stable memory usage and detection latency <1ms even in scenarios with QPS of 100,000.
[0041] In this embodiment, a specific code example of the resource optimization layer in step S103 is as follows: / / Bloom Filter request filtering: reducing the overhead of invalid detection class RequestFilter { private static final BloomFilter <string>filter = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()),1000000); public static boolean shouldInspect(String requestId) { return !filter.mightContain(requestId); / / Filter processed requests } } / / PhantomReference resource reclamation: preventing memory leaks class ResourceCleaner extends PhantomReference <object>{ public ResourceCleaner(Object referent, ReferenceQueue<? super Object> q) { super(referent, q); } @Override public void clear() { SecurityContext.releaseResources(this); / / Release the real-time identification resources for high-risk data from step 2. super.clear(); } } The significance of the resource optimization layer is that the Bloom Filter improves the efficiency of filtering invalid requests to 99.9%, and the PhantomReference enables the automatic reclamation of detection resources, ensuring stable memory usage and detection latency of <1ms in scenarios with a QPS of 100,000, thus providing reliable protection for high-concurrency services.
[0042] Thus, by executing steps S101-S103, a three-layer architecture of dynamic loading layer, intelligent injection layer, and resource optimization layer has been implemented, achieving non-intrusive security protection at the application layer: Agent hot loading technology based on JVM-TI directly injects detection code when the business class is loaded, and combines the ASM framework to dynamically select high-frequency calling methods to inject detection logic, generating a lightweight package of <50KB; Bloom Filter filters 99.9% of duplicate requests, and PhantomReference automatically reclaims detection resources, reducing CPU utilization by 32.7% and ensuring memory stability; This allows for end-to-end behavior monitoring without decrypting HTTPS / TLS1.3 traffic when executing step S1, providing accurate input with millisecond-level latency for high-risk data identification, while supporting dynamic adaptation to containerized / Serverless architectures, laying the underlying technical foundation for real-time risk control.
[0043] In this embodiment, when performing step S2, which is the step of performing runtime data risk detection on user access behavior, the following steps can be specifically performed: S201. Based on user access behavior, construct composite feature engineering to obtain multi-dimensional feature vectors; S202. Train the LightGBM model; S203. Deploy the LightGBM model, input the multi-dimensional feature vector into the LightGBM model for processing, and obtain the risk detection results output by the LightGBM model.
[0044] The high-precision, low-latency high-risk data identification capability achieved in steps S201-S203, such as Figure 4 As shown, this is a runtime data risk detection mechanism based on an improved decision tree model. It constructs a multi-dimensional feature vector by integrating spatiotemporal characteristics of user behavior (operation time series, IP geographical migration path) with GDPR data sensitivity level standards. Combined with an interpretability feature selection strategy driven by SHAP value, a lightweight model (<200KB) is trained using the LightGBM framework, achieving an efficient inference of 5000 times per second. This reduces the false alarm rate from 12% to 3.5% and improves the F1 score to 0.92, providing accurate evidence for real-time risk supervision.
[0045] Reference Figure 4 The pseudocode for the specific implementation steps of RiskDetector.isHighRiskData called in step S102 is as follows: # Internal logic of the isHighRiskData method (Python pseudocode) def isHighRiskData(businessData): features = build_features(businessData) # Call the composite feature engineering to build `shap_values = model.predict(features)` # Call the trained LightGBM model return shap_values[0]>THRESHOLD# Return the risk assessment result Step S201: Construction of Composite Feature Engineering Composite feature engineering involves extracting time-series features of user operations (such as login time period and operation frequency) and IP geographic migration path features (such as cross-regional access), and combining them with GDPR data sensitivity level standards (personal data, special category data, etc.) to construct a spatiotemporal-sensitivity level 3-dimensional feature vector, which solves the problem of low recognition accuracy of traditional single feature models.
[0046] This solution employs a composite feature engineering approach to improve detection accuracy by constructing a 3D feature vector that integrates spatiotemporal and sensitivity levels. Time-series features extract the average user login time (login_hour_mean) and 24-hour operation frequency (op_freq_per_hour) to capture abnormal operation periods. IP geographic features calculate the total IP migration distance (ip_distance_sum) and the number of region changes (region_changes) to identify cross-regional access. GDPR sensitivity level quantifies data sensitivity. Finally, these features are combined into a structured input containing 5 dimensions, providing interpretable risk decision-making basis for the LightGBM model. A specific example is shown below: # Feature extraction example def build_features(user_behavior): # Time series characteristics (statistical distribution of operation periods) time_features = { 'login_hour_mean': np.mean(user_behavior.login_hours), 'op_freq_per_hour': len(user_behavior.ops) / 24 } # IP geolocation path characteristics (converted to latitude and longitude encoding) ip_path = [geoip.locate(ip) for ip in user_behavior.ips] ip_features = { 'ip_distance_sum': sum(haversine(p1, p2) for p1,p2 in zip(ip_path,ip_path[1:])), 'region_changes': len(set([geoip.region(ip) for ip in user_behavior.ips])) } # GDPR Sensitivity Levels (Levels 1-5, Level 5 being the highest) sensitivity = get_gdpr_level(user_behavior.data_type) return { time_features, ip_features, 'sensitivity': sensitivity} The examples of the multidimensional feature vectors obtained in step S201 after the above feature extraction are shown in Table 1.
[0047] Table 1
[0048] The significance of performing composite feature engineering in step S201 is to reduce the feature dimension by 60% through spatiotemporal feature composite encoding, while introducing GDPR standard to quantify data sensitivity, enabling the model to distinguish between "high-frequency normal operation" and "abnormal sensitive data access", providing structured input for accurate classification.
[0049] Step S202: LightGBM Model Training and SHAP Interpretation Step S202 uses the LightGBM framework to train the decision tree model, integrates the SHAP value calculation module to quantify the feature contribution, dynamically adjusts the tree depth (3-8 layers) to balance accuracy and speed, and solves the problems of model black box and overfitting.
[0050] Step S202 implements the training and SHAP interpretability analysis of the decision tree model based on LightGBM. Specifically, by setting a dynamic tree depth (3-8 layers) to balance accuracy and speed, the LightGBM model is trained as a binary classification model. Then, TreeExplainer is used to calculate the SHAP value, quantifying the contribution of each feature to the prediction result. Finally, a feature importance table is generated by sorting features according to their mean absolute SHAP values, revealing key risk factors such as "sensitivity level + IP migration distance + operation time period," providing interpretable decision-making basis for intercepting high-risk operations. Specific code example: # Model Training and SHAP Interpretation import lightgbm as lgb from shap import TreeExplainer # Parameter Settings params = { 'objective': 'binary', 'metric': 'binary_logloss', 'num_leaves': 31, 'learning_rate': 0.05, 'max_depth': 6# Dynamically adjust tree depth } # Training the model train_data = lgb.Dataset(X_train, label=y_train) model = lgb.train(params, train_data) # Calculate SHAP value explainer = TreeExplainer(model) shap_values = explainer.shap_values(X_test) # Feature importance ranking (in descending order of mean absolute SHAP value) feature_importance = pd.DataFrame({ 'feature': X.columns, 'importance': np.mean(np.abs(shap_values), axis=0) }).sort_values('importance', ascending=False) The formulas for calculating SHAP value and feature importance are as follows:
[0051] In the above formula, N is the number of samples in the test set. The feature contribution value for the i-th sample. Based on the formula and the example in step S201, assuming the test set contains 3 samples, the SHAP values of a certain feature in each sample are shown in Tables 2 and 3.
[0052] Table 2
[0053] Table 3
[0054] The calculation steps are as follows: 1. Take the absolute value as shown in Table 4: Table 4
[0055] 2. Calculate the mean absolute SHAP value login_hour_mean:2.5 / 3≈0.83 op_freq_per_hour:0.9 / 3≈0.30 ip_distance_sum:4.4 / 3≈1.47 region_changes: 1.6 / 3 ≈ 0.53 sensitivity: 6.3 / 3 = 2.10 Calculations showed that sensitivity (data sensitivity level) had the highest SHAP value, indicating its greatest contribution to identifying high-risk data; ip_distance_sum (IP migration distance) was second, verifying the effectiveness of combining spatiotemporal features with sensitivity level. The final ranking results are shown in Table 5.
[0056] Table 5
[0057] Based on the above, the significance of this step is to quantify the feature contribution through SHAP value, making the model decision interpretable (such as "sensitivity level = 5 and IP migration > 1000 km" triggering high risk), improving the F1 value to 0.92 (18% higher than the traditional model), dynamically adjusting the tree depth to avoid overfitting, and balancing accuracy (92%) and inference speed (80ms / inference).
[0058] Step S203: Deployment of the lightweight model In step S203, lightweight model deployment generates a lightweight model package of <200KB through model compression technology (quantization, pruning), which is then loaded into the business system without the RASP Agent's awareness, enabling efficient inference at runtime and solving the problems of large model size and difficult deployment in traditional models.
[0059] Lightweight model deployment utilizes LightGBM's quantization technology to compress the FP32 model into INT8 format, reducing memory usage by 70% and improving inference speed. The quantized model is serialized into a <200KB binary package (risk_model.bin) for containerized environment transmission. The RASP Agent reads the binary file and calls the RiskDetector.init() method, non-intrusively injecting the detection engine during the JVM class loading phase. This enables real-time risk detection capabilities with zero modification to the business system, ensuring model loading efficiency and system stability in high-frequency scenarios such as online transactions. A specific code example is shown below: # Model Compression and Loading import lightgbm as lgb # Quantization Model (FP32 to INT8) quantized_model = lgb.quantize(model, bits=8) # Generate a lightweight package (<200KB) with open('risk_model.bin', 'wb') as f: f.write(quantized_model.dump()) # RASP Agent Loading Without Awareness class RiskModelLoader { static void loadModel() { byte[] modelBytes = Files.readAllBytes(Paths.get("risk_model.bin")); RiskDetector.init(modelBytes); / / Inject the detection engine } } After compression, the performance comparison between the LightGBM model and the traditional model is as follows: Table 6
[0060] The significance of this step is to compress the lightweight model package to only 180KB, and dynamically load it through the RASP Agent without restarting the business system. This supports the elastic scaling of cloud-native microservices, ensures real-time detection in high-concurrency scenarios with an inference capability of 5000 times per second, and keeps model latency within 80ms to ensure smooth business operations.
[0061] This embodiment achieves efficient and accurate identification of high-risk data through composite feature engineering and the SHAP-LightGBM model: the F1 score reaches 0.92 and the false positive rate is only 3.5%, meeting the 98.7% interception rate requirement for financial transactions; the model latency is <80ms, supporting real-time detection at the QPS level of 100,000; the visualization of feature importance meets GDPR compliance audit requirements and avoids false interception; the model size is compressed to 15% of traditional solutions, adapting to containerization and serverless architectures, providing dynamic and accurate technical support for the real-time risk monitoring system.
[0062] In step S203, after deploying the LightGBM model, the multidimensional feature vector is input into the LightGBM model for processing to obtain the risk detection results output by the LightGBM model.
[0063] In this embodiment, when performing step S3, which is to perform real-time monitoring of user access behavior, the following steps can be executed: S301. Initiate the superior supervision and approval process; S302. Construct a view of oversight content and approval processes; S303. Send the supervision content and approval view to the superior and request the superior to perform the approval.
[0064] The principle of steps S301-S303 is as follows: Figure 5 As shown.
[0065] Reference Figure 5 Steps S301-S303, based on the dual-person mutual supervision operation technology, implement a real-time supervision model for high-risk behaviors. When isHighRiskData(businessData) returns TRUE (high-risk data), it calls isriggerSupervisionAndApproval(accountInfo, businessData) to achieve real-time supervision and approval by the superior.
[0066] Specifically, in step S301, the process enters the superior supervision and approval process. In the Agent's detection code, once the `isHighRiskData(businessData)` method is called and returns `businessData` as high-risk data, the `istriggerSupervisionAndApproval()` method is called to start the superior supervision and approval process. When starting the superior supervision and approval process, the user is prompted that their behavior is high-risk and needs to wait: a pop-up dialog box first indicates that the user's behavior is a high-risk data access behavior that requires superior supervision and approval. After the approval is completed, the approval result will be displayed and the dialog box will automatically close.
[0067] In step S302, when the superior supervision and approval process begins, `istriggerSupervisionAndApproval()` will construct the supervision content and approval view, such as: "Dear Leader [Name], your subordinate [Name] accessed high-risk data in a certain business system on [Date] at [Time]. Details of this data can be found at the `businessData` link. Please supervise whether this access behavior is compliant. If compliant, please enter 'Y' to reply with approval; if not, please enter 'N' to reply with approval." After constructing the supervision and approval view, the SMS content will be sent to the superior leader through the SMS gateway.
[0068] In step S303, after receiving the text message, the superior checks the high-risk data in the businessData link and asks the user about their intention to access the high-risk data. If it is confirmed to be compliant, the superior can reply with "Y" in the text message; otherwise, they can not reply or reply with "N" or other similar content.
[0069] In this embodiment, data corresponding to user access behaviors that are considered high-risk behaviors (such as data that the user access behavior needs to access or operate, data provided by the user access behavior, etc.) can only be allowed to pass through when "Y" is received in step S303, thereby ensuring data security.
[0070] In summary, the RASP-based user access behavior processing method in this embodiment implements a RASP-based dual-person mutual supervision operation scheme for high-risk data. It achieves full lifecycle security management of high-risk data through the following three technical principles: (1) To address the shortcomings of traditional RASP solutions, such as the need to shut down business systems for deployment, inability to parse encrypted traffic, and excessive resource consumption, a non-intrusive dynamic protection mechanism is constructed using the JVM-TI interface and the ASM framework. Detection code is dynamically injected during the class loading phase, and injection points are adaptively selected based on the method call frequency threshold to generate a lightweight detection package of <50KB. By filtering 99.9% of duplicate requests through BloomFilter and automatically reclaiming resources through PhantomReference, the CPU utilization rate is controlled within 70% of the traditional solution, ensuring a detection latency of <1ms in scenarios with a QPS of 100,000, achieving real-time behavior monitoring of business systems with zero modification, and providing millisecond-level accurate input for high-risk data identification. (2) To address the problem that traditional models rely on single features, resulting in low recognition rates, false alarm rates as high as 12%, and failure to meet audit requirements, this invention integrates user operation time series, IP geographical migration paths, and GDPR data sensitivity levels to construct a three-dimensional composite feature vector. It uses the LightGBM framework to train a lightweight model (<200KB), integrates SHAP value analysis to quantify feature contribution, and dynamically adjusts the tree depth (3-8 layers) to balance accuracy and speed, achieving an accurate recognition with an F1 score of 0.92 and a false alarm rate of 3.5%. The model's inference capability reaches 5000 times per second. By visualizing feature importance, it meets the GDPR compliance audit requirements and has intercepted 98.7% of high-risk operations in the securities trading system, combining the advantages of accuracy, real-time performance, and compliance. (3) In view of the problems that traditional solutions lack a real-time interception mechanism for high-risk data access, have long approval response time (>1 minute) and are easily exploited by malicious users, this invention automatically triggers a two-person mutual supervision approval process when high-risk data access is detected. The superior user must verify the data with biometrics and dynamic password before the data can be released, which effectively prevents malicious users from abnormally obtaining high-risk data through business logic.
[0071] Based on the above technical principles, the RASP-based user access behavior processing method in this embodiment achieves the following effects: (1) Application-layer non-intrusive dynamic protection technology based on JVM-TI and ASM framework: This technology achieves real-time detection of user behavior through a three-layer architecture; the first layer is a dynamic loading layer that uses the premain method of Java Agent to register class converters, intercepts target business classes and injects detection code during the class loading stage, and supports seamless access to cloud-native environments; the second layer is an intelligent injection layer that dynamically selects injection points based on the method call frequency threshold (default 5 times / second), inserts high-risk data detection logic through ASM (calls RiskDetector.isHighRiskData), and generates a lightweight detection package of <50KB; the third layer is a resource optimization layer that uses Bloom Filter to filter 99.9% of duplicate requests, and combines PhantomReference to automatically reclaim detection resources, keeping the CPU utilization rate within 70% of the traditional solution, ensuring memory stability and detection latency <1ms in QPS scenarios of 100,000. This solution can achieve full-process behavior monitoring without modifying business code, providing accurate input with millisecond-level latency for high-risk data identification, and supports dynamic adaptation to containerized / Serverless architectures; (2) Interpretable detection technology based on spatiotemporal-sensitivity level composite features and SHAP-LightGBM: This technology constructs a three-dimensional feature vector by integrating user operation time series, IP geographical migration path and GDPR data sensitivity level to solve the problem of insufficient accuracy of traditional single feature models; it uses the LightGBM framework to train a lightweight model (<200KB), integrates SHAP value analysis to quantify feature contribution, and dynamically adjusts the tree depth (3-8 layers) to balance accuracy and speed, achieving accurate identification with an F1 value of 0.92 and a false alarm rate of 3.5%; combined with the non-intrusive deployment technology of RASP Agent, the quantified model is compressed to 180KB and dynamically injected into the business system to ensure 5000 inferences per second and a latency within 80ms, meeting the real-time detection requirements of financial-grade high-concurrency scenarios, while meeting GDPR compliance audit requirements through feature importance visualization.
[0072] (3) Real-time monitoring and approval process for high-risk behaviors: Once high-risk data is identified in a user's access behavior, the system will automatically trigger an approval process, requiring approval from a superior user before access can continue. This real-time monitoring and approval mechanism ensures strict control over high-risk data and effectively prevents data leakage and abuse. At the same time, the dual-person mutual supervision operation mode further enhances the security and compliance of data access.
[0073] A computer program that executes the RASP-based user access behavior processing method in this embodiment can be written into [the system / platform]. Figure 6 In the computer device or storage medium shown, when the computer program is read and run, the RASP-based user access behavior processing method of this embodiment is executed, thereby achieving the same technical effect as the RASP-based user access behavior processing method in the embodiment. For example, when the computer program is written to... Figure 6 The memory in the computer device shown can be used by the processor to read computer programs from the memory and execute the RASP-based user access behavior processing method in this embodiment.
[0074] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. Furthermore, the descriptions of "upper," "lower," "left," and "right" used in this disclosure are only relative to the relative positional relationships of the components of this disclosure in the accompanying drawings. The singular forms "a" and "the" used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. Moreover, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this embodiment specification is only for describing particular embodiments and is not intended to limit the invention. The term "and / or" as used in this embodiment includes any combination of one or more of the associated listed items.
[0075] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. The use of any and all instances or exemplary language ("e.g.," "such as," etc.) provided in this embodiment is intended only to better illustrate embodiments of the invention and, unless otherwise required, does not impose a limitation on the scope of the invention.
[0076] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented using standard programming techniques—including a non-transitory computer-readable storage medium configured with a computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner—according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).
[0077] Furthermore, the procedures described in this embodiment can be performed in any suitable order unless otherwise indicated by this embodiment or clearly contradicted by the context. The procedures (or variations and / or combinations thereof) described in this embodiment can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. A computer program includes multiple instructions executable by one or more processors.
[0078] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention of this embodiment includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques of the invention, the invention also includes the computer itself.
[0079] A computer program can be applied to input data to perform the functions of this embodiment, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.
[0080] The above are merely preferred embodiments of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.< / object> < / string>
Claims
1. A user access behavior processing method based on RASP, characterized in that, The RASP-based user access behavior processing method includes: By dynamically injecting RASP, non-intrusive real-time behavior detection is performed to detect user access behavior. Perform runtime data risk detection on the user access behavior; When the detection determines that the user's access behavior is high-risk, real-time monitoring of the user's access behavior is performed.
2. The user access behavior processing method based on RASP according to claim 1, characterized in that, The method of dynamically injecting RASP to perform non-intrusive real-time behavior detection, thereby detecting user access behavior, includes: The Agent hot-loading mechanism is implemented by loading the JVM-TI tool interface, and behavior detection code is injected during the loading process of the business class through the JVM-TI tool interface; The ASM framework is used to detect the number of method calls. When the number of method calls exceeds a preset threshold, the behavior detection code is injected to detect the user's access behavior. Run the Bloom Filter to filter detection requests and reclaim resources using PhantomReference.
3. The user access behavior processing method based on RASP according to claim 1, characterized in that, The runtime data risk detection performed on the user access behavior includes: Based on the user access behavior, a composite feature engineering is constructed to obtain a multi-dimensional feature vector. Training the LightGBM model; Deploy the LightGBM model, input the multidimensional feature vector into the LightGBM model for processing, and obtain the risk detection result output by the LightGBM model.
4. The user access behavior processing method based on RASP according to claim 3, characterized in that, The process involves constructing a composite feature engineering model based on the user's access behavior. Obtain multidimensional feature vectors, including: Extract the time-series features and IP geographic migration path features of the user access behavior; The multidimensional feature vector is constructed based on the time series features and the IP geographical migration path features.
5. The user access behavior processing method based on RASP according to claim 4, characterized in that, The step of constructing the multidimensional feature vector based on the time series features and the IP geographic migration path features includes: Based on the time series characteristics, extract the average user login time period and the 24-hour operation frequency; Based on the IP geographical migration path characteristics, calculate the total IP migration distance and the number of regional changes; Obtain the GDPR sensitivity level of the user's access behavior; The multidimensional feature vector is composed of the average user login time period, the 24-hour operation frequency, the total distance of IP migration, the number of regional changes, and the GDPR sensitivity level.
6. The user access behavior processing method based on RASP according to claim 3, characterized in that, The training of the LightGBM model includes: Set the dynamic tree depth; Based on the dynamic tree depth, the LightGBM model is trained as a binary classification model; The TreeExplainer was used to calculate the SHARP value for each feature output by the LightGBM model. Interpret the decision results of the LightGBM model based on the SHARP value.
7. The user access behavior processing method based on RASP according to claim 3, characterized in that, Deploying the LightGBM model includes: A lightweight model package of the LightGBM model is generated using model compression technology; The LightGBM model is loaded into the business system using the RASP Agent.
8. The user access behavior processing method based on RASP according to claim 1, characterized in that, The real-time monitoring of the user access behavior includes: Initiate the supervision and approval process from higher authorities; Build a view of oversight content and approval processes; The supervision content and the approval view are sent to the superior, requesting the superior to perform the approval.
9. A computer device, characterized in that, It includes a memory and a processor, the memory being used to store at least one program, and the processor being used to load at least one program to execute the RASP-based user access behavior processing method according to any one of claims 1-8.
10. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the RASP-based user access behavior processing method according to any one of claims 1-8.
