An audit log summarization method, device and system based on recursive call
By dynamically associating recursion depth with node security level in recursive call scenarios, and employing three-level log granularity adjustment and security level change event monitoring, the contradiction between log volume control and critical security event recording is resolved, achieving efficient log storage and security event traceability.
Patent Information
- Application Number
- CN202611010953.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies struggle to balance log volume control and complete recording of critical security events in recursive call scenarios, leading to the loss of critical security information in deep nodes or the generation of redundant logs in deep recursion. There is a lack of an effective correlation and unified processing mechanism between recursion depth and data security level.
By dynamically associating recursion depth with node security level type, a three-level progressive mode (full/summary/count aggregation) is adopted to adaptively adjust log granularity. Combined with real-time monitoring of security level change events and a full recording mechanism, log summaries are generated and archived.
It achieves significant reduction in log storage overhead, retains critical audit information without loss, provides real-time risk awareness and efficient security incident tracing capabilities, and ensures the integrity and immutability of audit information.
Smart Images

Figure CN123178453A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audit log management technology, and in particular to an audit log summarization method, apparatus and system based on recursive calls. Background Technology
[0002] In the realm of audit log management involving recursive calls, such as in confidential information systems, distributed microservice architectures, or operating system kernels, there is an inherent contradiction between the explosive growth of log volume and the complete recording of critical security events.
[0003] In existing technologies, one of the following methods is commonly used to control log storage overhead: First, a log discarding strategy based on a fixed depth threshold, where a single maximum depth limit is set, and logs from recursive call nodes exceeding this threshold are directly discarded. While simple, this approach is unrelated to the business semantics of node execution, potentially leading to the complete loss of traces of critical security operations such as changes in security level or denied permissions occurring in deep nodes, thus compromising audit integrity. Second, a full logging strategy based on specific event types, where detailed logging is triggered when preset critical events such as denied permissions or system anomalies occur. While this approach can capture critical events, it lacks awareness of recursion depth. Frequent triggering of such events in deep recursion can still generate massive amounts of duplicate or redundant logs, failing to effectively solve the problem of log volume expansion.
[0004] Furthermore, existing technologies struggle to effectively correlate recursion depth with the data security level processed by nodes. This is primarily because recursion depth is typically managed by the program scheduler, while data security level is managed by the security tagging engine; the two are isolated in terms of data structure and management. Simultaneously, the goals of depth control (deep recursion with less data recorded) and security level control (sensitive data recorded completely) directly conflict in scenarios involving deep recursive processing of sensitive data. Moreover, depth threshold determination is usually a static decision at the node entry point, while critical events such as security level changes occur dynamically during node execution; existing architectures lack a unified mechanism to coordinate this spatiotemporal mismatch.
[0005] Therefore, how to construct a log digest method that can adaptively compress log volume with recursion depth and ensure the integrity and auditability of critical security events based on data security level is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] The main objective of this invention is to provide an audit log summarization method, apparatus, and system based on recursive calls, aiming to solve the technical problem in the prior art that it is difficult to balance log volume control and complete recording of critical security events in recursive call scenarios.
[0007] To achieve the above objective, the present invention provides an audit log summarization method based on recursive calls. Nodes in the recursive call tree are sequentially denoted as node 0, node 1, node 2, ..., node i, node i+1, ... in the order of invocation, where node 0 is the root node, and processed according to the following steps: Step S1: Obtain a shallow threshold D_shallow and a deep threshold D_deep of the current node i, wherein the shallow threshold D_shallow and the deep threshold D_deep are threshold parameter groups preconfigured according to the security classification type of the current node i, and D_shallow < D_deep; Step S2: For the current node i, dynamically allocate a log recording mode according to the interval position where the recursive depth value of the current node i falls between the shallow threshold D_shallow and the deep threshold D_deep, record the log of the current node i according to the allocated log recording mode, generate a log summary R_i of the current node i, merge the log summary R_i of the current node i with the previous node cumulative summary R_accum(i-1), and update the merged result as the current node cumulative summary R_accum(i); Step S3: Determine whether the current node i has a next-layer child node i+1. If yes, set the depth value of the next-layer child node i+1 to the depth value of the current node i plus 1, assign the next-layer child node i+1 as the current node i, and return to Step S2; if no, return the current cumulative summary R_accum(i) to the upper-level parent node; Step S4: In response to the completion of processing for all nodes, take node 0 as the archiving unit, package the logs of all nodes and the final cumulative summary R_accum(0) into an archive package for archiving.
[0008] The present invention further provides a recursive call-based audit log summarization device, comprising: a node numbering module configured to sequentially number nodes in a recursive call tree as Node 0, Node 1, Node 2, ..., Node i, Node i+1, ... according to call order, wherein Node 0 is a root node; a threshold acquisition module configured to acquire a shallow threshold D_shallow and a deep threshold D_deep for the current Node i, wherein the shallow threshold D_shallow and the deep threshold D_deep are threshold parameter groups preconfigured according to the security level type of the current Node i, and D_shallow < D_deep; a depth acquisition module configured to acquire a recursive depth value of the current Node i; a mode allocation module connected to the depth acquisition module, configured to dynamically allocate a log recording mode according to the interval position of the recursive depth value of the current Node i falling between the shallow threshold D_shallow and the deep threshold D_deep; a log recording module connected to the mode allocation module, configured to record logs of the current Node i according to the allocated log recording mode, and generate a log summary R_i of the current Node i; an accumulation summary module connected to the log recording module, configured to merge the log summary R_i of the current Node i with a previous node accumulation summary R_accum(i-1), and update the merged result as a current node accumulation summary R_accum(i); a recursion control module connected to the accumulation summary module, configured to determine whether the current Node i has a next-layer child node i+1, if yes, set the depth value of the next-layer child node i+1 to the depth value of Node i plus 1, assign the next-layer child node i+1 as the current Node i, and re-trigger the depth acquisition module; if no, return the current accumulation summary R_accum(i) to a parent node of a previous level; an archiving module connected to the recursion control module, configured to package logs of all nodes and the accumulation summary R_accum(0) into an archive package for archiving by taking Node 0 as an archiving unit in response to completion of processing of all nodes.
[0009] The present invention further provides an adaptive recursive call audit log summarization system, characterized by comprising: one or more processors; and a memory coupled to the one or more processors and storing executable instructions; the executable instructions, when executed by the one or more processors, implement the recursive call-based audit log summarization method according to any one of the preceding items.
[0010] Compared with existing technologies, this invention has the following advantages: By attaching the recursion depth and node security level type to the same node (node 0, node 1, ..., node i, node i+1), joint decision-making between the two is achieved, breaking the isolation between the deep scheduler and the security tag engine in existing technologies; through a three-level progressive mode (full / digest / count aggregation), the log granularity changes from fine to coarse as the depth increases, compressing the log storage overhead in deep recursion scenarios to 1 / 10 to 1 / 100 of the full record; the three-level mode retains key snapshots through the digest mode and retains statistical information through the count aggregation mode, ensuring that key audit information is not lost while the full record is significantly compressed. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating an audit log summarization method based on recursive calls according to an embodiment of the present invention.
[0012] Figure 2 This is a schematic diagram of an audit log summarization device based on recursive calls according to an embodiment of the present invention.
[0013] Figure 3 This is a schematic diagram illustrating the principle of the relationship between recursive calls and log mode partitioning according to an embodiment of the present invention. Detailed Implementation
[0014] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0015] Example 1 As attached Figure 1 As shown, this application provides an audit log summarization method based on recursive calls, aiming to resolve the inherent contradiction between the explosive growth of log volume and the complete recording of critical security events when processing recursive calls in existing technologies. Existing technologies typically employ a fixed-depth discarding strategy, which easily leads to the loss of critical security information from deep nodes, or they use event-based full recording, generating a large amount of redundant logs in deep recursion. This solution achieves adaptive adjustment of log granularity by dynamically associating recursion depth with data security level.
[0016] This method first identifies the nodes in the recursive call tree according to the order of the calls, for example, denoted as node 0, node 1, node 2, ..., node i, node i+1, etc., where node 0 is the root node. Specifically, the recursive call tree involved in this method refers to a tree structure formed by a series of nested or recursive calls triggered by an initial call (root node), where each call instance constitutes a node. For example... Figure 3As shown, the recursive call tree 301 includes a root node 0 (302) and a series of child nodes derived from it, such as node i (304) and node j (306), each node having a specific recursion depth.
[0017] The purpose of this step is to establish a unique identity and a clear position in the call chain for each call instance, providing a unified carrier for subsequent joint decision-making based on depth and security level, thereby overcoming the shortcomings of existing technologies where deep scheduling information and security label information are isolated from each other.
[0018] Subsequently, when processing the current node i, step S1 (102) is executed to obtain the shallow threshold D_shallow and deep threshold D_deep of the current node i. These two thresholds are a pre-configured threshold parameter group based on the confidentiality type of the data processed by the current node i, and D_shallow <D_deep。
[0019] Specifically, the shallow threshold D_shallow and the deep threshold D_deep refer to two key recursive depth thresholds used to dynamically divide different log recording patterns. For example... Figure 3 As shown, these two thresholds divide the entire recursive call tree 301 into three logical regions 307: a full log region 308 with a depth no greater than D_shallow, a summary log region 309 with a depth between D_shallow and D_deep, and a counting aggregation region 310 with a depth greater than D_deep. The magnitude of these two thresholds determines the aggressiveness of the logging policy. The principle behind this design is to directly link the coarseness / detail of the logging policy to the sensitivity of the data being processed. By pre-configuring rather than dynamically calculating at runtime, this scheme decouples static configuration from dynamic execution, ensuring decision-making efficiency and solving the spatiotemporal mismatch problem between static depth thresholds and dynamic density changes in existing technologies. Next, step S2 is executed. For the current node i, the log recording mode is dynamically allocated according to the position of the recursion depth value of the current node i falling into the interval of the shallow threshold D_shallow and the deep threshold D_deep. The log of the current node i is recorded according to the allocated log recording mode, the log summary R_i of the current node i is generated, and the log summary R_i of the current node i is merged with the cumulative summary R_accum(i-1) of the previous node. The merged result is updated to the cumulative summary R_accum(i) of the current node.
[0020] Specifically, the log summary R_i refers to a summary or complete log record generated for the current node i based on a specific log recording pattern. Its level of detail depends on the log pattern of the node; it may be a complete flow of operation events, a summary of key information, or a statistical count of events.
[0021] The cumulative summary R_accum(i) is a comprehensive summary formed by merging the log summary R_i of the current node i with the cumulative summaries of all its descendant nodes. It represents the log information of the entire subtree rooted at the current node. In this way, log information can be aggregated layer by layer from the leaf nodes upwards, eventually forming a complete description of the entire call process at the root node.
[0022] Specifically, the dynamic allocation log recording modes include: When the depth value of the current node i is not greater than D_shallow, the system adopts full log mode (104). This typically corresponds to the beginning of the call chain, where the business logic of these nodes is often more critical and unique, requiring the most detailed logging for auditing. By logging all operation events, lossless tracing of the core call path is ensured.
[0023] When the depth value of the current node i is greater than D_shallow but not greater than D_deep, the system switches to summary log mode (105). These nodes are in the intermediate layer of the recursion, and their behavior may have some repetition. By adopting summary mode, the redundancy of full recording is avoided, while retaining the necessary context information, thus achieving a balance between information fidelity and storage efficiency.
[0024] When the depth of the current node i is greater than D_deep, the system employs a counting aggregation mode (106). This typically occurs at the tail of depth recursion, where the behavior patterns of these nodes are highly repetitive, such as element-wise processing of a large data structure. In this case, recording individual operations is less meaningful than counting the occurrences of various events. In this way, the log volume is compressed to the extreme while still retaining a macroscopic insight into the behavioral patterns of this level.
[0025] After assigning a log mode, the system records the log of the current node i according to the mode, generates a log digest R_i for the current node i, and merges it with the cumulative digest R_accum(i-1) of the previous node (or its parent node), updating it to the current node's cumulative digest R_accum(i), as shown in step 107. This merging process is crucial for achieving bottom-up information aggregation, ensuring that the parent node can obtain the execution overview of all its descendant nodes.
[0026] The purpose of step S2 is to achieve an intelligent balance between log completeness and storage overhead, overcoming the conflict of objectives caused by the "one-size-fits-all" strategy in existing technologies. Through this layered and progressive strategy, the rule of "the greater the depth, the fewer the logs" is achieved, significantly reducing the total amount of logs.
[0027] Then, in step S3, the recursive control logic is executed. As shown in decision box 108, it is determined whether the current node i has a next-level child node i+1. If it does, the recursion continues, the depth of child node i+1 is set to the depth of the current node i plus 1, and child node i+1 is taken as the new current node. The process is then returned to step S2 (109) and the same process is performed on it. If it does not exist, it means that the current node is a leaf node or the processing of all its child nodes has been completed. At this time, the current cumulative summary R_accum(i) is returned to its parent node (110) so that the parent node can perform summary merging.
[0028] Finally, in step S4, when all nodes have finished processing, i.e., the recursive call has completely ended and control has returned to root node 0, the system uses root node 0 as the archiving unit, packages the original logs (if any) of all nodes and the final cumulative summary R_accum(0) into an archive and archives it (111). This archive constitutes a complete, self-contained audit unit, recording all the important information of this recursive call, which is convenient for post-event analysis, accountability and review.
[0029] In a preferred embodiment, the summary information recorded in the above-mentioned summary log mode is specified. This summary information may include node start time, node end time, hash values of input parameters, security level of output data, node execution duration, and error status. The technical advantage of this design is that it provides a standardized set of "node snapshots," allowing auditors to obtain key information even without complete operation logs: when the node was executed; its execution duration; the content of the input (whose integrity is verified via hashing); the security level of the output data; and whether the execution was successful. By recording this highly condensed yet information-rich metadata, this solution significantly reduces log volume while retaining most of the core audit value.
[0030] In another preferred implementation, the counting aggregation mode is also refined. The event types counted under this mode can include data read events, permission check pass events, permission check deny events, de-identification trigger events, sub-skill call events, and abnormal events. Furthermore, when the permission check deny event count or abnormal event count is detected to be non-zero, an asynchronous alarm push is triggered. The technical effect of this design is to establish a highly efficient deep node risk monitoring mechanism. In the deep recursion of extremely compressed logs, although the recording of normal operations is abandoned, it maintains high sensitivity to any events that indicate security risks or system instability (such as permission denial or program abnormalities). Through real-time alarms, operations or security personnel can immediately notice problems occurring in deep calls, achieving real-time risk perception capabilities with extremely low log overhead, which is completely impossible with traditional log discarding strategies.
[0031] Furthermore, in a preferred embodiment, the configuration strategy for the shallow threshold D_shallow and the deep threshold D_deep is optimized. These two thresholds can be configured differently based on the security level of the data processed by the current node i. For example, for a node processing "top secret" data, D_shallow can be configured to a sufficiently large value (e.g., 9999) so that the actual recursion depth of this node and all its descendant nodes is no greater than D_shallow, thereby forcing the use of a full log mode and ensuring that operations on the most sensitive data are recorded completely and accurately. For nodes processing ordinary "internal" data, more lenient system default values (e.g., D_shallow=2, D_deep=5) can be used. In addition, any modification to these threshold parameter groups requires a strict security approval process, and the modification record itself is also written to the audit log. The technical effect of this design is that it elevates the granularity of the logging strategy to a new level, realizing an adaptive security model of "high-secret data, strict logging strategy; low-secret data, broad logging strategy," enabling security resources to be precisely deployed to where they are most needed.
[0032] To address dynamically emerging security risks during execution, this invention also provides an important supplementary mechanism. In a preferred embodiment, regardless of the current node's log mode (even if it's a summary or count aggregation mode), "security level change events" are continuously monitored in step S2 above. Once such an event is detected, the system immediately forces a switch to full log mode for that specific event. The principle behind this design is that routine, predictable operations can be compressed and recorded, but any unexpected events that may lead to changes in security status must be recorded in detail. This forms a closed-loop logic of "routine compression, detailed investigation of anomalies."
[0033] Furthermore, as a continuation of the above implementation method, when a security classification change event is switched to full log mode, the recorded information may include, but is not limited to: the event trigger time, the unique identifier ID of the current node i, the recursion depth of the current node i, the security classification before the change, the security classification after the change, the anonymized values of the data identifiers involved, and a description of the triggering reason. Recording such detailed information provides ample evidence for in-depth analysis of security events. Auditors can accurately reconstruct the complete context of the event, for example, in which node and at which level of recursion, which specific data was accessed (located through anonymized identifiers), causing the security classification to change from what level to what level. This greatly improves the traceability and analyzability of security events.
[0034] In another preferred embodiment, the detection scope of security level change events is specifically defined. These triggering conditions may include: the current node i accesses a data row with a security level higher than the current context security level during execution; the dynamic de-identification engine triggers a de-identification operation on a certain data field of the current node i; the permission check module of the security kernel layer returns a rejection result for a certain operation of the current node i; or the security level propagation strategy execution module determines that the output security level of the current node i is higher than the context security level passed in by its parent node. The technical effect of this definition is that it concretizes the abstract "security level change event" into four types of typical security-related operations that can be accurately monitored by the system. This makes the mechanism highly operable, effectively capturing most scenarios related to dynamic changes in data security levels in practice, ensuring the coverage and effectiveness of the security supplement mechanism.
[0035] To ensure the final integrity, authenticity, and immutability of audit logs, this invention further strengthens the archiving process. In a preferred embodiment, the archive package generated in step S4 is digitally signed before being archived to an encrypted ledger service. Furthermore, the hash value of this archive package is written to a blockchain evidence storage module. The technical effect of this series of operations is to construct a multi-layered, high-strength chain of trusted evidence. Digital signatures (especially multi-party signatures) guarantee the authenticity of the log source and the integrity of the content; the encrypted ledger service ensures the confidentiality of the logs during long-term storage; and blockchain evidence storage, utilizing its decentralized and immutable characteristics, provides an irrefutable "timestamp" and "reliable evidence" for the existence and content summary of the logs. The combination of these three elements significantly enhances the credibility of the audit archives.
[0036] Example 2 To illustrate the application of the present invention more specifically, the following exemplary scenarios are provided, which do not constitute a limitation on the scope of protection of the present invention. This scenario is based on the method of Embodiment 1 and applied to a skill recursive invocation scenario in a confidentiality management information system.
[0037] In this scenario, a root request (node 0) to "generate an annual confidentiality report for a department" recursively calls the skill "statistics on the confidentiality level distribution of personnel in the department" (node 1), which in turn recursively calls the sub-skills "query the confidentiality level information of each employee" (nodes 2, 3, 4, ...).
[0038] The system pre-configures threshold parameter groups according to the confidentiality level of the data processed by each node, following step S1 of Example 1: For nodes processing "top secret" data, D_shallow is configured to a sufficiently large value (such as 9999) so that the actual recursion depth of the node and all its descendant nodes is not greater than D_shallow, thereby forcing the use of full log mode.
[0039] For nodes that process "confidential" data, configure D_shallow=1 and D_deep=3.
[0040] For nodes that process "internal level" data, configure the system default values D_shallow=2 and D_deep=5.
[0041] When a node with a depth of 4 is executing, it should be in summary log mode because its depth is greater than D_shallow=2 and not greater than D_deep=5. However, if this node accesses a "top secret" file, triggering a security level change event, the system will immediately switch the logging mode of the event to full log mode according to the mechanism in steps S5-S7 of Example 1, recording in detail the trigger time, the security level before the change, the security level after the change, and the data identifiers involved (after anonymization).
[0042] After the entire task is completed, the system follows step S4 of Example 1, using node 0 as the archiving unit, packages all the logs of all nodes and the final cumulative digest R_accum(0) into an archive package, archives it after digital signature, and writes the hash value into the blockchain for evidence storage.
[0043] The specific implementation steps of this scenario are the same as steps S1-S4 described in Embodiment 1, and will not be repeated here.
[0044] Example 3 To illustrate the application of the present invention more specifically, the following exemplary scenarios are provided, which do not constitute a limitation on the scope of protection of the present invention. This scenario is based on the method of Embodiment 1 and applied to a call chain tracing scenario in a distributed microservice architecture.
[0045] In this scenario, a user request (such as "place an order") triggers a call chain spanning multiple services, with each service call instance (Span) corresponding to a node. For example, the API gateway (node 0) calls the order service (node 1), the order service calls the inventory service (node 2) and the payment service (node 3), and the payment service further calls the risk control service (node 4), forming a nested call structure.
[0046] The system pre-configures threshold parameter groups according to the sensitivity level of the data processed by each service, following the method in step S1 of Example 1: For services that process "highly sensitive" data such as payment information and user identity, configure D_shallow to a sufficiently large value (such as 9999) so that the service and all its downstream nodes are forced to adopt full log mode, recording in detail the complete request parameters, response results, authentication tokens, encryption suites and other information for each RPC call.
[0047] For services that process "medium-sensitive" data such as order information and inventory information, configure D_shallow=1 and D_deep=4. Shallow nodes (depth 0-1) record the full transaction summary and key decisions; mid-level nodes (depth 2-4) record the summary, retaining only the request URI hash, response status code, and execution time; deep nodes (depth ≥ 5) use a counting aggregation mode to count the number of calls, success rate, and average execution time.
[0048] For services that process "low-sensitivity" data such as logs and monitoring, configure the system default values D_shallow=2 and D_deep=6.
[0049] When a risk control service node with a depth of 4 is executing, if the node detects that a transaction element matches the preset high-risk rule set and triggers a security level change event (i.e., the transaction sensitivity level jumps from medium sensitivity to high sensitivity), the system immediately switches the logging mode of the event to full log mode, and records in detail the trigger time, node ID, recursion depth, sensitivity level before the change, sensitivity level after the change, the account identifier involved (after de-identification), and a description of the trigger reason.
[0050] After the entire call chain is completed, the system follows the method of step S4 in Example 1, using the request trace ID (TraceID) of the root node (node 0) as the archiving unit, packages the logs of all nodes with the final cumulative digest, archives them after digital signature, and writes the hash value to the blockchain for evidence storage.
[0051] Example 4 To illustrate the application of the present invention more specifically, the following exemplary scenarios are provided, which do not constitute a limitation on the scope of protection of the present invention. This scenario is based on the method of Embodiment 1 and applied to the scenario of operating system kernel function call stack auditing.
[0052] In this scenario, a system call (such as traversing a directory tree) triggers a recursive function call in the kernel, with each frame of the call stack corresponding to a node. For example, the root call (node 0, depth 0) calls the directory traversal function, which recursively calls itself to traverse subdirectories (nodes 1, 2, 3, ..., with increasing depth).
[0053] The system pre-configures threshold parameter groups according to the security level of the data processed by each function, following the method in step S1 of Example 1: For functions that handle "critical security" operations such as password verification, permission checks, and enforcement of security policies, configure D_shallow to a sufficiently large value (such as 9999) so that the function and all its recursively called sub-functions are forced to use full logging mode, recording detailed information such as function input parameters, return values, permission check results, and access object identifiers.
[0054] For functions handling "normal security" operations such as file path resolution and directory entry reading, configure D_shallow=2 and D_deep=6. Shallow nodes (depth 0-2) record full directory details; mid-level nodes (depth 3-6) record a summary, retaining only the path hash, file type, and execution cycle count; deep nodes (depth ≥ 7) use a counting aggregation mode to count the number of files, subdirectories, permission denials, and error code distribution.
[0055] For functions that handle "low-security" operations such as pure mathematical calculations and string manipulations, configure the system default values D_shallow=3 and D_deep=8.
[0056] When a function call frame with a depth of 5 is being executed, if the function attempts to access a special directory protected by a security policy (such as " / etc / shadow"), triggering a security level change event (i.e., the security level of the accessed object jumps from normal to sensitive), the system immediately switches the logging mode of the event to full log mode, recording in detail the trigger time, node ID (stack pointer value), recursion depth, security level of the accessed object before the change, security level of the accessed object after the change, the file path involved (after de-identification processing), and a description of the trigger reason.
[0057] After the entire system call is completed, the system follows the method of step S4 in Example 1, using the process ID and system call number of the root node (node 0) as the archiving unit, packages the logs of all call frames with the final cumulative digest, archives them after digital signature, and writes the hash value to the blockchain for evidence storage.
[0058] Example 5 To illustrate the application of the present invention more specifically, the following exemplary scenarios are provided, which do not constitute a limitation on the scope of protection of the present invention. This scenario is based on the method of Embodiment 1 and is applied to an intelligent monitoring scenario of east-west traffic in a cloud-native service mesh.
[0059] In this scenario, the service mesh processes a user request (such as "product query"), which triggers east-west traffic calls between multiple microservices, forming a nested service call chain. Each service proxy (Sidecar) handles a request forwarding and governance operation, corresponding to a node. For example, the ingress gateway (node 0) calls the product service (node 1), the product service calls the inventory service (node 2), the inventory service calls the cache service (node 3), and the cache service calls the database service (node 4), forming recursive or nested calls.
[0060] The system pre-configures threshold parameter groups according to the Service Level Agreement (SLA) level of the service corresponding to each node, following the method in step S1 of Example 1: For "core services" (such as order service, payment service, and user authentication service), the SLA level is "Gold". D_shallow is configured to a sufficiently large value (such as 9999) so that all nodes of this service and its downstream calls are forced to adopt full logging mode, which records in detail the complete header, body, response time, number of retries, circuit breaker status, rate limiting triggering status, etc. for each request.
[0061] For "normal services" (such as product queries and inventory queries), the SLA level is "Silver," with D_shallow=1 and D_deep=4 configured. Shallow nodes (depth 0-1) record the entire request; mid-level nodes (depth 2-4) record a summary, retaining only the request URI hash, response status code, execution time, and error type; deep nodes (depth ≥ 5) use a counting aggregation mode to count the total number of requests, successful requests, failed requests, timeouts, and circuit breaker attempts under that branch.
[0062] For "basic services" (such as log collection, monitoring metric reporting, and configuration retrieval), the SLA level is "bronze", and the system default values are D_shallow=2 and D_deep=6.
[0063] When a cache service node with a depth of 5 is executing, if the node detects that the request involves sensitive user data (such as ID card number, mobile phone number, home address), triggering a security level change event (i.e., the data security level jumps from "normal" to "sensitive"), the system immediately switches the logging mode of the event to full log mode, recording in detail the trigger time, node ID, recursion depth, data security level before the change, data security level after the change, data identifiers involved (after de-identification processing), and a description of the trigger reason.
[0064] After the entire call chain is completed, the system follows the method of step S4 in Example 1, using the request trace ID (TraceID) of the root node (node 0) as the archiving unit, packages the logs of all nodes with the final cumulative digest, archives them after digital signature, and writes the hash value to the blockchain for evidence storage.
[0065] Example 6 As attached Figure 2 As shown in the figure, this application embodiment also provides an audit log summarization device 200 based on recursive calls, which is a hardware or physical implementation of the above method. The device includes: a node numbering module 201, a threshold acquisition module 202, a depth acquisition module 203, a pattern allocation module 204, a log recording module 205, a cumulative summary module 206, a recursion control module 207, and an archiving module 208.
[0066] Specifically, the node numbering module 201 is used to record the nodes in the recursive call tree in the order of the call as node 0, node 1, node 2, ..., node i, node i+1, ..., where node 0 is the root node.
[0067] The threshold acquisition module 202 is used to acquire the shallow threshold D_shallow and the deep threshold D_deep of the current node i, wherein the shallow threshold D_shallow and the deep threshold D_deep are a set of threshold parameters pre-configured according to the security level type of the current node i, and D_shallow <D_deep。
[0068] The depth acquisition module 203 is used to obtain the recursion depth value of the current node i.
[0069] The pattern allocation module 204 is connected to the depth acquisition module, and is used to determine the position of the current node i within the interval between the shallow threshold D_shallow and the deep threshold D_deep, based on the recursive depth value of the current node i. When the depth value is not greater than D_shallow, allocate the full log mode; When the depth value is greater than D_shallow but not greater than D_deep, allocate the summary log mode; When the depth value is greater than D_deep, allocate count aggregation mode; The log recording module 205 is connected to the mode allocation module 204. It is used to record the log of the current node i according to the allocated log recording mode and generate the log summary R_i of the current node i.
[0070] The cumulative summary module 206 is connected to the log recording module. It is used to merge the log summary R_i of the current node i with the cumulative summary R_accum(i-1) of the previous node and update it to the cumulative summary R_accum(i) of the current node. The recursive control module 207, connected to the cumulative summary module 206, is used to determine whether the current node i has a next-level child node i+1. If it exists, then set the depth value of the next-level child node i+1 to the depth value of node i plus 1, assign the value of the next-level child node i+1 to the current node i, and trigger the depth acquisition module again; If it does not exist, return the current cumulative summary R_accum(i) to the next higher parent node; The archiving module 208, connected to the recursive control module 207, is used to package and archive the logs and cumulative summaries R_accum(0) of all nodes in response to the completion of processing of all nodes, with node 0 as the archiving unit.
[0071] These modules work together to fully implement all the logic of the aforementioned method.
[0072] This application also provides an adaptive recursive call audit log summarization system, which can be a server, an embedded device, or a distributed system cluster. The system typically includes one or more processors and memory coupled to the processors. The memory stores executable program instructions that, when executed by the processor, can fully implement the recursive call-based audit log summarization method of Embodiment 1 described above. For example, the processor executes instructions to perform a series of operations such as obtaining thresholds, comparing depths, allocating modes, logging, merging summaries, recursive control, and final archiving.
[0073] It should be noted that the above detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0074] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments described in this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0075] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.
[0076] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.
[0077] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatial relative descriptions used herein will be interpreted accordingly.
[0078] In the detailed description above, reference has been made to the accompanying drawings, which form part of this document. In the drawings, similar symbols typically identify similar parts unless the context otherwise indicates otherwise. The illustrated embodiments described in the detailed specification, drawings, and claims are not intended to be limiting. Other embodiments may be used and other changes may be made without departing from the spirit or scope of the subject matter presented herein.
[0079] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for summarizing audit logs based on recursive calls, characterized in that, The nodes in the recursive call tree are sequentially labeled as node 0, node 1, node 2, ..., node i, node i+1, ..., where node 0 is the root node, and processed according to the following steps: Step S1: Obtain the shallow threshold D_shallow and deep threshold D_deep of the current node i, wherein the shallow threshold D_shallow and the deep threshold D_deep are a set of threshold parameters pre-configured according to the security level type of the current node i, and D_shallow <D_deep; Step S2: For the current node i, dynamically allocate a log recording mode based on the position of the current node i's recursion depth value falling within the interval of the shallow threshold D_shallow and the deep threshold D_deep, and record the log of the current node i according to the allocated log recording mode, generating a log summary R_i for the current node i, and Merge the log digest R_i of the current node i with the cumulative digest R_accum(i-1) of the previous node, and update the current node's cumulative digest R_accum(i) with the merged result. Step S3: Determine if the current node i has a next-level child node i+1. If it exists, set the depth value of the next-level child node i+1 to the depth value of the current node i plus 1, then assign the value of the next-level child node i+1 to the current node i, and return to step S2; If it does not exist, the current cumulative summary R_accum(i) is returned to the next higher parent node; Step S4: In response to the completion of processing of all nodes, take node 0 as the archiving unit, package the logs of all nodes and the final cumulative summary R_accum(0) into an archive package and archive it.
2. The method according to claim 1, characterized in that, The dynamic log recording mode, which dynamically allocates log records based on the interval position of the current node i falling within the shallow threshold D_shallow and the deep threshold D_deep, includes: When the depth value of the current node i is not greater than D_shallow, the full log mode is adopted to record all operation events of the current node i; When the depth value of the current node i is greater than D_shallow but not greater than D_deep, a summary log mode is adopted to record summary information of the execution process of the current node i. When the depth value of the current node i is greater than D_deep, a counting aggregation mode is used to count the occurrence times of each event type of the current node i.
3. The method according to claim 2, characterized in that, The summary information recorded in the summary log mode includes at least one of the following: node start, node end, input parameter hash, output security level, execution duration, and error status; and The event types counted under the counting aggregation mode include at least one of the following: data read event, permission check passed event, permission check denied event, de-identification triggered event, sub-skill call event, and abnormal event; Furthermore, when the permission check denial event count or the abnormal event count is not zero, an asynchronous alarm push is triggered.
4. The method according to claim 1, characterized in that, The shallow threshold D_shallow and deep threshold D_deep are configured differently based on the security level of the data processed by the current node i: for nodes processing top-secret data, the threshold parameter group is configured so that the node and all its child nodes adopt full log mode; for nodes processing internal data, the threshold parameter group is configured to the system default value; wherein, the modification of the threshold parameter group takes effect after security approval, and the modification record is written to the audit log.
5. The method according to claim 2, characterized in that, In step S2, the method further includes: in response to the current node i detecting a security level change event, switching the log recording mode of the security level change event in the current node i to the full log mode.
6. The method according to claim 5, characterized in that, When the security level change event is switched to full log mode, the recorded information includes, but is not limited to: the event trigger time, the node ID of the current node i, the recursion depth of the current node i, the security level before the change, the security level after the change, the anonymized value of the data identifiers involved, and a description of the triggering reason.
7. The method according to claim 5, characterized in that, The detection range of the security level change event includes at least one of the following triggering conditions: During execution, the current node i accesses a data row with a security level higher than the current context security level. The dynamic desensitization engine triggers a desensitization operation on a certain data field of the current node i; The permission check module of the security kernel layer returns a denial result for a certain operation of the current node i; The security level propagation strategy execution module determines that the security level produced by the current node i is higher than the context security level passed in by its parent node.
8. The method according to claim 1, characterized in that, In step S4, the file package is also digitally signed and archived to the encrypted ledger service, and the hash value of the file package is written into the blockchain evidence storage module.
9. An audit log summarization device based on recursive calls, characterized in that, include: The node numbering module is used to sequentially label the nodes in the recursive call tree as node 0, node 1, node 2, ..., node i, node i+1, ..., where node 0 is the root node; The threshold acquisition module is used to acquire the shallow threshold D_shallow and the deep threshold D_deep of the current node i, wherein the shallow threshold D_shallow and the deep threshold D_deep are a set of threshold parameters pre-configured according to the security level type of the current node i, and D_shallow <D_deep; The depth acquisition module is used to obtain the recursion depth value of the current node i. The mode allocation module, connected to the depth acquisition module, is used to dynamically allocate log recording modes based on the interval position of the current node i's recursive depth value falling into the shallow threshold D_shallow and the deep threshold D_deep. The log recording module, connected to the mode allocation module, is used to record the log of the current node i according to the allocated log recording mode and generate the log summary R_i of the current node i. The cumulative summary module, connected to the log recording module, is used to merge the log summary R_i of the current node i with the cumulative summary R_accum(i-1) of the previous node and update it to the cumulative summary R_accum(i) of the current node. The recursive control module, connected to the cumulative summary module, is used to determine whether the current node i has a next-level child node i+1. If it exists, the depth value of the next-level child node i+1 is set to the depth value of node i plus 1, the next-level child node i+1 is assigned the value of the current node i, and the depth acquisition module is triggered again. If it does not exist, return the current cumulative summary R_accum(i) to the next higher parent node; The archiving module, connected to the recursive control module, is used to package the logs and cumulative summaries R_accum(0) of all nodes into an archive and archive it in response to the completion of processing of all nodes, taking node 0 as the archiving unit.
10. An adaptive recursive call audit log summary system, characterized in that, include: One or more processors; and a memory, coupled to the one or more processors, storing executable instructions; When the executable instructions are executed by the one or more processors, they implement the audit log digest method based on recursive calls as described in any one of claims 1 to 8.
