Memory abnormal data detection method, device, computer equipment and storage medium
By injecting memory exception detection packets into the Java virtual machine, loading the target class object and injecting detection logic functions before and after the execution of the key functions, the timeliness and accuracy of memory exception detection of Java virtual machine is solved, ensuring the stability and reliability of the JVM.
Patent Information
- Application Number
- CN202411993025.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing technology cannot detect abnormal data in Java virtual machine memory in a timely and accurate manner, resulting in memory leaks or overflow problems, affecting application performance and stability.
By pre-injecting the memory exception detection data packet, in response to the memory exception data detection instruction, the target class object is loaded, the function interception strategy is used to match the target execution function, and the detection logic function is injected before and after its execution, obtaining performance running data to determine memory exceptions.
It realizes timely and accurate detection of Java virtual machine memory, improves the timeliness and accuracy of memory detection, reduces the time delay from the occurrence of problems to detection, and ensures the stability and reliability of the JVM.
Smart Images

Figure CN119917328B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a method, apparatus, computer equipment, and storage medium for detecting abnormal memory data. Background Art
[0002] The Java Virtual Machine (JVM) is an abstract computer system that provides an operating environment that enables Java programs to run on a variety of hardware and operating system platforms. This allows developers to focus on business logic without having to worry about differences in the underlying hardware and operating system, simplifying the development process and reducing maintenance costs. However, in real-world applications, if a program fails to properly manage memory or requests more memory than the JVM can provide, memory leaks or memory overflows can occur. These problems gradually deplete available memory resources, ultimately significantly degrading application performance, increasing response times, and in severe cases, even leading to service interruptions or system crashes. Therefore, timely and effective memory monitoring is crucial to ensuring the stability and reliability of the JVM.
[0003] In the related art, JVM memory is typically monitored periodically using monitoring tools (such as jstat and jcmd) to output JVM performance statistics at specified intervals. These statistics are then used to generate performance reports to help technicians understand the JVM's operational status. However, this approach only collects data at predetermined time points, and events that occur outside of the monitoring time points are not recorded. This makes it impossible to detect abnormal memory data in a timely and accurate manner. Summary of the Invention
[0004] The main purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for detecting abnormal memory data, which can improve the timeliness and accuracy of abnormal memory data detection.
[0005] To achieve the above objectives, a first aspect of an embodiment of the present application provides a method for detecting abnormal data in memory, the method comprising:
[0006] In response to the memory abnormality data detection instruction, running a pre-injected memory abnormality detection data packet; wherein the memory abnormality detection data packet is used to detect the usage of the target memory;
[0007] Responding to a pending request, and loading at least one target class object according to the pending request;
[0008] Determine multiple to-be-executed functions contained in the at least one target class object currently loaded, and match each to-be-executed function using multiple function interception strategies of multiple preset task execution entrances to obtain a matching result;
[0009] When the matching result indicates that there is at least one target execution function among the multiple functions to be executed that matches the function interception strategy of at least one task execution entry, injecting a detection logic function before and after the execution logic of the at least one target execution function;
[0010] Acquire, by the detection logic function, a plurality of performance operation data corresponding to when executing the at least one target execution function, wherein each performance operation data is associated with a memory usage of the target memory when executing the at least one target execution function;
[0011] The over-limit threshold corresponding to each performance operation data is obtained, and the memory abnormal data detection result of the target memory is determined according to the size relationship between each performance operation data and the corresponding over-limit threshold.
[0012] Accordingly, a second aspect of an embodiment of the present application provides a device for detecting abnormal data in a memory, the device comprising:
[0013] A response module, configured to execute a pre-injected memory anomaly detection data packet in response to a memory anomaly data detection instruction; wherein the memory anomaly detection data packet is used to detect the usage of the target memory;
[0014] A loading module, configured to respond to a pending request and load at least one target class object according to the pending request;
[0015] a matching module, configured to determine a plurality of to-be-executed functions contained in the at least one target class object currently loaded, and match each to-be-executed function using a plurality of function interception strategies of a plurality of preset task execution entrances to obtain a matching result;
[0016] an injection module, configured to, when the matching result indicates that there is at least one target execution function among the multiple functions to be executed that matches the function interception strategy of at least one task execution entry, inject a detection logic function before or after the execution logic of the at least one target execution function;
[0017] an acquisition module, configured to acquire, through the detection logic function, a plurality of performance operation data corresponding to the execution of the at least one target execution function, wherein each performance operation data is associated with a memory usage of the target memory when the at least one target execution function is executed;
[0018] A determination module is used to obtain the over-limit threshold corresponding to each performance operation data, and determine the memory abnormal data detection result of the target memory based on the size relationship between each performance operation data and the corresponding over-limit threshold.
[0019] In some embodiments, the plurality of performance operation data includes the execution duration of the target execution function, the number of complete garbage collections and the number of young generation garbage collections within the execution cycle of the target execution function, and the total execution memory consumption. The acquisition module is further configured to:
[0020] Obtaining, by means of the detection logic function, an execution start time and an execution end time of the at least one target execution function, and determining an execution duration of the at least one target execution function based on the execution start time and the execution end time;
[0021] Obtaining a first complete garbage collection count of the system at the start of execution of the at least one target execution function and a second complete garbage collection count of the system at the end of execution of the at least one target execution function, and determining a number of complete garbage collections within an execution cycle of the at least one target execution function based on the first complete garbage collection count and the second complete garbage collection count;
[0022] Obtaining a first young generation garbage collection count of the system at the start of execution of the at least one target execution function and a second young generation garbage collection count of the system at the end of execution of the at least one target execution function, and determining a young generation garbage collection count within an execution cycle of the at least one target execution function based on the first young generation garbage collection count and the second young generation garbage collection count;
[0023] Obtain a first memory amount allocated to the target thread executing the at least one target execution function at the beginning of execution of the at least one target execution function, and a second memory amount allocated to the target thread executing the at least one target execution function at the end of execution of the at least one target execution function, and determine the total execution memory consumption within the execution cycle of the at least one target execution function based on the difference between the second memory amount and the first memory amount.
[0024] In some embodiments, the multiple performance operation data include the execution time of the target execution function, the number of full garbage collections and the number of young generation garbage collections within the execution cycle of the target execution function, and the total execution memory consumption; the exceeding thresholds include an execution time threshold, an average memory application rate threshold, a memory consumption threshold, a full garbage collection number threshold, and a young generation garbage collection number threshold; the determination module is further used to:
[0025] The determining, based on a magnitude relationship between each performance operation data and the corresponding over-limit threshold, a memory abnormality data detection result of the target memory includes:
[0026] Calculating an average memory request rate of the target execution function based on a ratio of the total execution memory consumption to the execution time;
[0027] Obtaining a first detection sub-result based on a first comparison result obtained by comparing the execution time with the execution time threshold, and a second comparison result obtained by comparing the average memory request rate with the average memory request rate threshold;
[0028] Obtaining a second detection sub-result based on a magnitude relationship between the total execution memory consumption and the memory consumption threshold;
[0029] combining a third comparison result obtained based on the magnitude relationship between the number of complete garbage collections and the threshold number of complete garbage collections with the second detection sub-result to obtain a third detection sub-result;
[0030] Combining a fourth comparison result obtained based on the magnitude relationship between the number of young generation garbage collection times and the threshold number of young generation garbage collection times with the second detection sub-result to obtain a fourth detection sub-result;
[0031] A memory abnormal data detection result of the target execution function is determined based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result.
[0032] In some embodiments, the memory abnormal data detection device further includes an adding module for:
[0033] When it is necessary to ignore the memory usage when calling the first to-be-executed function, add an ignore annotation to the first to-be-executed function;
[0034] When the first to-be-executed function matches the function interception strategy corresponding to any of the task execution entries, a detection logic function is not injected before or after the execution logic of the first to-be-executed function.
[0035] In some embodiments, the memory abnormal data detection device further includes a search module for:
[0036] Obtaining a uniform resource locator associated with the pending request, and searching in an ignore policy table based on the uniform resource locator to obtain a search result;
[0037] When the search result indicates that the pending request corresponds to at least one performance ignore item, the performance ignore item is marked in at least one target execution function corresponding to the pending request so as to ignore the size relationship between the target performance operation data corresponding to the performance ignore item and the corresponding over-limit threshold when determining the memory abnormality data detection result of the target memory.
[0038] In some embodiments, the memory abnormal data detection device further includes a comparison module for:
[0039] Obtaining a memory change range of the amount of memory allocated to the target thread of each target execution function when calling each target execution function; wherein the memory change range is calculated by the difference between the maximum amount of memory allocated to the target thread of each target execution function during the processing of each target execution function and the minimum amount of memory allocated;
[0040] Obtaining a preset amplitude threshold, and comparing the memory change amplitude with the preset amplitude threshold to obtain an amplitude comparison result;
[0041] When the amplitude comparison result indicates that the number of times the memory change amplitude exceeds the preset amplitude is less than the preset number, the logic code of the target execution function is modified to reduce the memory change amplitude when the target execution function processes any pending request.
[0042] In some embodiments, the memory abnormal data detection device further includes an analysis module for:
[0043] Storing detection data generated when executing the target execution function within a function execution cycle in an information storage module of the target memory, and transmitting the detection data to an early warning module set relative to the target memory after the target execution function is executed; wherein the detection data includes detection metadata generated by the task execution entry for the target execution function, playback data during the execution of the target execution function, and the plurality of performance operation data; the early warning module is separated from the target thread that processes the target execution function;
[0044] When the memory abnormality data detection result indicates that the usage of the target memory is abnormal, replay data is obtained from the early warning module;
[0045] Based on the playback data, an abnormality cause analysis is performed on the target memory to obtain an abnormality cause analysis result.
[0046] Correspondingly, the third aspect of the embodiments of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the memory abnormal data detection method described in any one of the embodiments of the first aspect of the present application.
[0047] Correspondingly, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the memory abnormal data detection method described in any one of the embodiments of the first aspect of the present application.
[0048] In an embodiment of the present application, in response to a memory abnormality data detection instruction, a pre-injected memory abnormality detection data packet is executed; wherein the memory abnormality detection data packet is used to detect the usage of the target memory; in response to a pending request, at least one target class object is loaded according to the pending request; a plurality of to-be-executed functions contained in the currently loaded at least one target class object are determined, and each to-be-executed function is matched through a plurality of function interception strategies of a preset plurality of task execution entries to obtain a matching result; when the matching result indicates that there is at least one target execution function among the plurality of to-be-executed functions that matches the function interception strategy of at least one task execution entry, a detection logic function is injected before and after the execution logic of the at least one target execution function; through the detection logic function, a plurality of performance operation data corresponding to the execution of the at least one target execution function is obtained, wherein each performance operation data is associated with the memory usage of the target memory when the at least one target execution function is executed; an over-limit threshold corresponding to each performance operation data is obtained, and the memory abnormality data detection result of the target memory is determined based on the size relationship between each performance operation data and the corresponding over-limit threshold. In this way, the memory usage of the entire process of executing the target execution function can be actively detected through the pre-injected memory anomaly detection data packet. Specifically, the present application can locate the memory detection to the function level, and by matching the interception strategy for each function to be executed, no function that needs to be focused on is missed, and the function that needs to be focused on can be accurately located; further, by injecting the detection logic function before and after the execution logic of the successfully matched target execution function, the performance operation data of the successfully matched target execution function can be detected before the request is processed and after the processing is completed, so as to ensure that all memory usage can be captured in time and accurately detected, and no key events will be missed; finally, by comparing the size relationship between the performance operation data obtained by detection and the over-limit threshold, it can be ensured that an abnormal event can be quickly discovered once it occurs, reducing the time delay from the occurrence of the problem to the detection of the problem, and improving the accuracy of memory detection. In summary, the present application can improve the timeliness and accuracy of memory abnormality data detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of the architecture of the memory abnormal data detection system provided by an embodiment of the present application;
[0050] Figure 2 This is a flowchart of a method for detecting abnormal memory data provided by an embodiment of the present application;
[0051] Figure 3 This is a schematic diagram of the functional modules of the memory abnormal data detection device provided in an embodiment of the present application;
[0052] Figure 4 This is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0056] The Java Virtual Machine (JVM) is an abstract computer system that provides an operating environment that enables Java programs to run on a variety of hardware and operating system platforms. This allows developers to focus on business logic without having to worry about differences in the underlying hardware and operating system, simplifying the development process and reducing maintenance costs. However, in real-world applications, if a program fails to properly manage memory or requests more memory than the JVM can provide, memory leaks or memory overflows can occur. These problems gradually deplete available memory resources, ultimately significantly degrading application performance, increasing response times, and in severe cases, even leading to service interruptions or system crashes. Therefore, timely and effective memory monitoring is crucial to ensuring the stability and reliability of the JVM.
[0057] In the related art, JVM memory is typically monitored periodically using monitoring tools (such as jstat and jcmd) to output JVM performance statistics at specified intervals. These statistics are then used to generate performance reports to help technicians understand the JVM's operational status. However, this approach only collects data at predetermined time points, and events that occur outside of the monitoring time points are not recorded. This makes it impossible to detect abnormal memory data in a timely and accurate manner.
[0058] Based on this, the embodiments of the present application provide a method, apparatus, computer device and storage medium for detecting abnormal memory data, which can improve the timeliness and accuracy of abnormal memory data detection.
[0059] The memory abnormal data detection method, device, computer equipment and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the memory abnormal data detection system in the embodiments of the present application is described.
[0060] Please refer to Figure 1 In some implementations, an embodiment of the present application provides a memory abnormal data detection system, including a terminal 11 and a server 12 .
[0061] For example, terminal 11 can be a device with which a user directly interacts, such as a developer's computer, a test machine, or any location running a client application. Terminal 11 can provide a user interface (UI) for configuring monitoring policies and viewing alarm information. Terminal 11 can also deploy lightweight applications or tools for communicating with the server, such as requesting monitoring data or sending control commands through an application programming interface (API).
[0062] Furthermore, the server 12 can be a computer device that executes business logic and services. The server 12 can be deployed in a data center or in the cloud. The server 12 can host major application services, including but not limited to web servers and application servers. Furthermore, a Java virtual machine can be deployed on the server 12 to run Java applications to process related requests.
[0063] For example, terminal 11 and server 12 can communicate via a network interface. Terminal 11 can send a request to server 12, which then processes the corresponding pending request and returns a processing result. Furthermore, while processing the pending request, server 12 can detect the entire function execution process in the target memory and determine a memory anomaly data detection result for the target memory.
[0064] The memory abnormal data detection method in the embodiment of the present application can be illustrated by the following embodiment.
[0065] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0066] In the embodiment of the present application, the invention will be described from the perspective of a memory abnormal data detection device, which can be integrated into a computer device. Figure 2 , Figure 2 This is a flowchart of the steps of the memory abnormal data detection method provided in an embodiment of the present application. In this embodiment of the present application, the memory abnormal data detection device is specifically integrated into a terminal or server as an example. When the processor on the terminal or server executes the program instructions corresponding to the memory abnormal data detection method, the specific process is as follows:
[0067] Step 101 : In response to a memory abnormality data detection instruction, a pre-injected memory abnormality detection data packet is executed; wherein the memory abnormality detection data packet is used to detect usage of a target memory.
[0068] In some implementations, in order to implement non-intrusive detection of JVM memory, a memory anomaly detection data packet may be pre-injected into the JVM to establish a flexible and efficient real-time memory detection trigger mechanism without modifying the original code.
[0069] The memory anomaly data detection instruction can be a command or signal that triggers the memory detection mechanism to start working. For example, the memory anomaly data detection instruction can be an API call, a specific Hypertext Transfer Protocol (HTTP) request, a command line parameter, or automatically activated by a condition preset in a configuration file. The memory anomaly data detection instruction can be issued by a system administrator, operation and maintenance personnel, or an automated monitoring script to initiate a detailed inspection of JVM memory usage.
[0070] The memory anomaly detection package can be a Java agent and its associated libraries that contain a series of monitoring logic and functions. The memory anomaly detection package can be seamlessly integrated into the running JVM instance without modifying the original Java application code.
[0071] The target memory can be the heap space in each generation within the JVM, including but not limited to the Young Generation, Old Generation, and PermGen / Metaspace. These areas are the memory resources occupied by different stages of the Java object life cycle and are also the focus of garbage collector management.
[0072] In some embodiments, when a memory anomaly data detection instruction is received, the system will wake up the memory anomaly detection data packet that has been pre-injected into the JVM, make it enter an active state and start collecting necessary detection information. Normally, due to the lightweight characteristics of the memory anomaly detection data packet, the memory anomaly detection data packet can run all the time and be loaded when the JVM starts to avoid missing abnormal situations.
[0073] In some embodiments, the memory anomaly detection data packet may include an interception point definition module for determining the specific method that needs to be monitored, an aspect-oriented programming (AOP) interception module responsible for inserting additional detection logic functions before and after the execution of a specified function to be executed, a monitoring information collection module for capturing multiple performance operation data, an exception notification strategy module for issuing an alarm when a target memory anomaly occurs, a parameter replay module for replaying data, and the like.
[0074] By responding to memory anomaly data detection instructions and running pre-injected memory anomaly detection data packets, developers can be provided with a simple way to quickly diagnose and locate memory-related problems without having to redeploy the entire application, thereby improving the system's usability and stability.
[0075] Step 102: respond to the request to be processed and load at least one target class object according to the request to be processed.
[0076] In some implementations, in order to determine which class instances will participate in the request to be processed, the target class object corresponding to the request to be processed may be loaded to accurately locate all potential execution paths related to the request to be processed.
[0077] A pending request is a specific operation request initiated by a client (which can be an end user, other service, or automated system) to a server. A pending request can include a Uniform Resource Locator (URL), a request to call a specific function, or perform a task, such as an HTTP request, a Remote Procedure (RPC) call, or a task in a message queue, instructing the server to perform a specific operation or service.
[0078] The target class object may be an instance of a Java class instantiated by the JVM and loaded into the target memory when the program is running. The target class object contains functions and properties to be executed that implement business logic and can respond to operation instructions from pending requests.
[0079] In some embodiments, after receiving the pending request on the server side, a router component can be used to determine the back-end component corresponding to the distribution of the pending request. The router can match the information of the pending request (such as the URL path) with the preset routing rules, determine the corresponding processor, and load the corresponding target class object (such as the Controller class in the Spring framework). The target class object contains the to-be-executed function that can process the pending request.
[0080] Furthermore, when the pending request is distributed to the corresponding target class object being loaded, the monitoring logic of the memory exception detection data packet will be triggered to intercept the corresponding target pending function that may cause memory exception.
[0081] By responding to pending requests and loading target class objects, it achieves accurate routing and processing of server-side operation requests, while triggering memory anomaly detection to monitor and prevent potential memory problems in real time, improving system stability and reliability and optimizing resource management.
[0082] Step 103: determine multiple functions to be executed contained in the at least one target class object currently loaded, and match each function to be executed through multiple function interception strategies of multiple preset task execution entrances to obtain a matching result.
[0083] In some embodiments, in order to identify and filter out pending functions that require special monitoring, that is, pending functions that may cause target memory exceptions, preset function interception measurements can be applied to each pending function to ensure that only those critical and potentially risky pending functions are monitored, rather than monitoring all functions indiscriminately, thereby reducing unnecessary performance overhead.
[0084] The function to be executed may be a specific method contained in a target class object, and is a basic unit for actually executing business logic in an application. By running the function to be executed, the request to be processed can be processed.
[0085] The task execution entry may be an interface defined in the application, through which the execution process of the business logic may be entered.
[0086] Among them, the function interception strategy can refer to a set of preset rules or conditions for determining the to-be-executed functions that need to be intercepted and injected with monitoring logic.
[0087] The matching result is the result of matching each pending function against the function interception policy. This refers to the result of comparing the pending function with the function interception policy. Specifically, it indicates whether a specific function meets the given interception conditions, thus determining whether the function will be targeted for monitoring.
[0088] For example, the function to be executed can be part of the business logic or a basic service provided by the framework (such as a thread pool task, a scheduled task, etc.). Each function to be executed has its own unique signature (including class name, method name, parameter list, etc.) and can exist in different target class objects.
[0089] Specifically, the task execution entry can be an important part of the application architecture. For example, the task execution entry can include the Java Development Kit (JDK) thread pool task execution entry responsible for scheduling and managing concurrent tasks, the JDK scheduled task execution entry used to periodically execute scheduled tasks, the Spring scheduled task execution entry provided by the Spring framework, the Spring MVC request processing entry that processes HTTP requests and maps them to corresponding controller methods, the service execution entry when the Dubbo Provider side receives a remote call in a distributed service call, etc. Different task execution entries can execute different functions to be executed.
[0090] Exemplary function interception strategies can be classpath matching strategies, method signature matching strategies, annotation-driven strategies, and so on. Specific function interception strategies can be defined based on actual conditions, and this application does not impose specific restrictions. Taking the classpath matching strategy as an example, the function interception strategy for task execution entry a can be to intercept only method calls of all classes under the com.example.service.* package, etc.; taking the method signature matching strategy as an example, the task execution entry can be to intercept only functions named processOrder whose parameters are OrderDTO objects, and so on. These are not listed here one by one.
[0091] In some implementations, the system may automatically assign a task execution entry corresponding to each function to be executed, and the like.
[0092] In some embodiments, when any function to be executed is marked as @Monitor, that is, when monitoring is enabled, regardless of whether the function to be executed is intercepted or not, the function to be executed is used as the target execution function, and the detection logic function is injected before and after the execution logic of the target execution function. Conversely, when any function to be executed is marked as @Monitor Ignore, that is, when monitoring is ignored, regardless of whether the function to be executed is intercepted or not, there is no need to inject the detection logic function into the function to be executed. In this way, excessive monitoring of non-critical methods can be avoided, reducing unnecessary performance overhead.
[0093] For example, the pending functions marked as @Mon itor can be key business logic functions that directly affect user experience or system stability (such as order processing, payment confirmation, etc.), functions involving database access, network requests, file reading and writing, and other operations that may affect performance, newly developed functional functions, functions that need to run for a long time, etc. The pending functions marked as @Mon itor Ignore can be simple auxiliary functions, functions with known problems that cannot be fixed for the time being, functions that are frequently called but have low overhead, etc., and the embodiments of this application do not impose specific restrictions on this.
[0094] Specifically, when any function to be executed is matched with the function interception strategy of at least one task execution entry, each function to be executed can be matched as a successful match, and the function to be executed is used as the target execution function, and the detection logic function is injected before and after the execution logic of the target execution function; conversely, when the function to be executed does not match the function interception strategy of any task execution entry, the matching result can be obtained as a failed match, and the function to be executed is ignored, and there is no need to inject the detection logic function to reduce unnecessary system overhead.
[0095] Through the above methods, the system can efficiently and accurately screen out key functions that require further monitoring. This not only improves the flexibility and accuracy of monitoring, but also supports fine-grained performance management down to the function level, improving system stability and user experience.
[0096] Step 104 : When the matching result indicates that there is at least one target execution function among multiple functions to be executed that matches the function interception strategy of at least one task execution entry, a detection logic function is injected before and after the execution logic of the at least one target execution function.
[0097] In some embodiments, in order to perform performance monitoring and data collection before and after the execution of a successfully matched function to be executed, a detection logic function can be injected before and after the execution logic of the target execution function to ensure that critical business logic is fully monitored while reducing unnecessary performance overhead generated by monitoring the execution of non-critical functions.
[0098] The target execution function can be a specific method or function selected from multiple pending functions that requires special attention and has its performance and behavior monitored. The target execution function is a key business logic unit in the application or a function that is likely to affect the target memory.
[0099] The detection logic function may be an additional code automatically inserted to monitor the target execution function.
[0100] Specifically, when the matching result represents that among multiple functions to be executed, there is at least one target execution function that matches the function interception strategy of at least one task execution entry, for example, when the function to be executed a matches the function interception strategy of the task execution entry a, the function to be executed a can be used as the target execution function, and the detection logic function can be injected into it before and after the execution logic.
[0101] In some implementations, Aspect-Oriented Programming (AOP) technology can be used to inject a detection logic function before and after the execution logic of at least one selected target execution function. For example, if one target execution function is:
[0102]
[0103] Furthermore, AOP technology can be used to define pre-detection logic functions and post-detection logic functions for the target execution function:
[0104]
[0105] Furthermore, if the performance operation data to be monitored is the execution duration and the total execution memory consumption, the front-end detection logic function is configured to record the execution start time and the first memory amount allocated to the target thread executing at least one target execution function when the target execution function starts executing:
[0106]
[0107] Furthermore, a post-detection logic function is configured to record the execution end time and the second memory amount allocated to the target thread executing at least one target execution function when the target execution function ends execution:
[0108]
[0109] Furthermore, you need to apply the AOP framework to the above function to ensure that the AOP framework can recognize and apply the above aspects:
[0110]
[0111] It should be noted that the above logic detection function is only an example. Without departing from the concept of this application, the detection logic function can be adjusted according to actual conditions, and the embodiments of this application do not impose specific restrictions on this.
[0112] In some embodiments, other performance operation data besides execution time and total execution memory consumption can be obtained by setting a detection logic function, such as the number of full garbage collections, the number of young generation garbage collections, etc., to comprehensively and accurately monitor the usage of the target memory.
[0113] By injecting detection logic before and after the target execution function, cross-cutting concerns can be dynamically woven into the code before and after the target execution function without affecting the original code, simplifying the code structure and enhancing maintainability and reusability. This approach also enables fine-grained function-level monitoring of target memory usage, comprehensively capturing and analyzing memory usage, promptly identifying performance bottlenecks and memory anomalies, and improving application stability and efficiency.
[0114] In some implementations, in order to reduce false positives or focus on more important monitoring targets, the memory usage of specific functions to be executed can be ignored to reduce unnecessary monitoring data and improve monitoring effectiveness. For example, the memory abnormality data detection method may also include:
[0115] (A.1) When it is necessary to ignore the memory usage when calling the first function to be executed, add an ignore annotation to the first function to be executed;
[0116] (A.2) When the first function to be executed matches the function interception strategy corresponding to any task execution entry, the detection logic function is not injected before or after the execution logic of the first function to be executed.
[0117] The memory usage may be a memory allocation and release status in the JVM heap space during the running of the application.
[0118] The ignore annotation (such as @Mon itor Ignore) can be a special Java annotation used to identify the first to-be-executed function that should not be intercepted and detected. When the first to-be-executed function with the ignore annotation is scanned, the first to-be-executed function can be skipped and no additional monitoring operations are performed on it.
[0119] In some embodiments, when it is necessary to ignore the memory usage of any first to-be-executed function, a specific ignore annotation (such as @Mon itor Ignore) can be added to the function to explicitly indicate that the function does not need to be monitored. At runtime, the system will check whether each to-be-executed function meets the monitoring conditions according to the preset function interception strategy. If a first to-be-executed function with an ignore annotation successfully matches the function interception strategy of any task execution entry, for example, if the first to-be-executed function a with an ignore annotation successfully matches the function interception strategy of the task execution entry a, the system will not inject detection logic functions before or after the execution logic of the first to-be-executed function.
[0120] Exemplarily, the following types of functions to be executed can be determined as the first functions to be executed: functions used to process sensitive data, functions with known operational failures that have not been resolved yet, non-critical but large-scale functions that require a large number of interception matches, temporary or transitional functions, functions in the testing or debugging stage, etc.
[0121] By flexibly adding ignore annotations, developers can precisely control which methods need to be monitored and which methods can be ignored based on specific application scenarios and needs, ensuring that key business logic is fully monitored while avoiding unnecessary performance overhead on non-critical or known problem functions. This improves system performance and efficiency, simplifies monitoring configuration management, and makes the code more concise and easier to maintain.
[0122] Step 105 : Acquire a plurality of performance operation data corresponding to the execution of at least one target execution function by detecting the logic function, wherein each performance operation data is associated with the memory usage of the target memory when the at least one target execution function is executed.
[0123] In some embodiments, in order to accurately evaluate the memory overhead when running each target execution function and identify potential memory leak problems, multiple performance operation data of the entire execution process of each target to-be-executed function can be obtained by detecting logical functions, so as to comprehensively and accurately obtain the memory usage when running the target execution function without affecting the normal business process.
[0124] Performance data can be a series of performance-related metrics collected during the execution of the target function. This data can reflect the system's memory usage during function execution, particularly memory usage. This data may include, but is not limited to, the execution duration of the target function, the number of full garbage collections and young generation garbage collections during the target function's execution cycle, and the total execution memory usage.
[0125] In some embodiments, a front-end logic detection function can be defined to record the starting state before the target execution function is executed, and then a post-end logic detection function can be defined to record the ending state after the target execution function is executed, and multiple performance operation data can be calculated based on the difference between the ending state and the starting state.
[0126] In some implementations, before the target execution function executes, the AOP-based detection logic function can obtain current memory usage, thread status, and other information through the Java Management Extensions (JME) interface as baseline data. After the target execution function executes, the detection logic function can again obtain the latest memory usage, thread status, and other information through JMX and calculate the changes.
[0127] Furthermore, the JVM management extension interface may include the ThreadMXBean interface and the GarbageCollectorMXBean interface. Specifically, the ThreadMXBean interface can be used to obtain thread information, including thread execution time and thread status; the GarbageCollectorMXBean interface can be used to obtain garbage collector information, including the number of young generation garbage collections and the number of full garbage collections.
[0128] By combining JMX and AOP technologies, we can accurately capture the performance operation data of key business methods, such as execution time, number of complete garbage collections, number of young generation garbage collections, total execution memory consumption, etc., without intruding the original business logic.
[0129] In some implementations, the JVM Management Interface (JMX) can provide the necessary performance data source for the detection logic functions defined by AOP, while AOP is responsible for dynamically inserting the detection logic at the appropriate location. The two complement each other and can jointly achieve efficient performance monitoring of the application, ensuring that key business logic is fully monitored while reducing unnecessary performance overhead for non-critical functions.
[0130] In some embodiments, in order to accurately determine whether the target memory is abnormal, the performance operation data during the execution of the target execution function can be obtained by detecting the logic function. The performance operation data may include execution time, number of complete garbage collections, number of young generation garbage collections, and total execution memory consumption, etc., to accurately measure the memory and performance of the target execution function and perform accurate anomaly detection. For example, step 105 may include:
[0131] (105.1) Obtaining an execution start time and an execution end time of at least one target execution function by detecting a logic function, and determining an execution duration of the at least one target execution function based on the execution start time and the execution end time;
[0132] (105.2) Obtaining a first full garbage collection count of the system at the start of execution of at least one target execution function, and a second full garbage collection count of the system at the end of execution of at least one target execution function, and determining a number of full garbage collections within an execution cycle of the at least one target execution function based on the first full garbage collection count and the second full garbage collection count;
[0133] (105.3) Obtaining a first young generation garbage collection count of the system at the start of execution of at least one target execution function, and a second young generation garbage collection count of the system at the end of execution of at least one target execution function, and determining a young generation garbage collection count within an execution cycle of the at least one target execution function based on the first young generation garbage collection count and the second young generation garbage collection count;
[0134] (105.4) Obtain a first memory amount allocated to a target thread executing at least one target execution function at the start of execution of at least one target execution function, and a second memory amount allocated to a target thread executing at least one target execution function at the end of execution of at least one target execution function, and determine a total execution memory consumption within the execution cycle of at least one target execution function based on the difference between the second memory amount and the first memory amount.
[0135] The execution start time may be the exact time point when the target execution function starts executing, and the execution start time may be recorded by a high-precision timer (such as System.nanoTime()).
[0136] The execution end time may be the exact time point when the target execution function completes execution, and may also be recorded using a high-precision timer.
[0137] The execution duration may be the actual running time of the target execution function. For example, the execution duration may be calculated by the difference between the execution end time and the execution start time.
[0138] The first full garbage collection number may be the number of full garbage collections (Full GC) that have occurred in the system when the target execution function starts to execute.
[0139] The second full garbage collection number may be the number of full garbage collections (Full GC) that have occurred in the system when the target execution function ends execution.
[0140] The number of full garbage collections may be the frequency of Full GC events during the entire execution of the target function, and may be used to determine whether excessive memory cleanup activity occurs. For example, the number of full garbage collections may be calculated as the difference between the second number of full garbage collections and the first number of full garbage collections.
[0141] The first young generation garbage collection number may be the number of young generation garbage collections (Young GC) that have occurred in the system when the target execution function starts to execute.
[0142] The second young generation garbage collection number may be the number of young generation garbage collections (Young GC) that have occurred in the system when the target execution function ends execution.
[0143] The number of young generation garbage collections may be the number of young generation garbage collections that occurred throughout the execution of the target execution function. The number of young generation garbage collections may be calculated as the difference between the number of the second young generation garbage collection and the number of the first young generation garbage collection. The number of young generation garbage collections may be used to indicate whether too many new objects were created or too many short-lived objects were created during the execution of the target execution function.
[0144] The first memory amount may be the total amount of memory allocated to the target thread executing the target execution function when the target execution function starts to execute.
[0145] The second memory amount may be the total amount of memory allocated to the target thread executing the target execution function when the target execution function ends execution.
[0146] The total execution memory consumption may be the total amount of memory allocated during the execution of the target execution function, and is used to determine whether there is a problem area causing a memory leak. The total execution memory consumption may be calculated as the difference between the second memory number and the first memory number.
[0147] Furthermore, a full garbage collection can be performed on the Old Generation within the JVM plus at least one other generation (such as the Young Generation). Full GC triggers include insufficient Old Generation space, insufficient Metaspace, and excessive garbage accumulation after a long period of system operation. Full garbage collection significantly impacts system performance because it causes a Stop-the-World pause (Stop-the-World pause) in the application. During garbage collection, all application threads are paused until the garbage collection is complete. The number of full garbage collections is closely related to memory usage during the execution of the target function.
[0148] Young generation garbage collection primarily targets the JVM's Young Generation, which is where newly created objects are stored and typically occupies a small portion of the heap memory. The purpose of young generation garbage collection is to reclaim objects that are no longer referenced and to move surviving objects to the Survivor space or promote them to the Old Generation. Young generation garbage collection can also cause brief application pauses, and the number of young generation garbage collections is closely related to memory usage during the execution of the target function.
[0149] For example, if there is a target execution function processData, it is necessary to detect its execution time, number of full garbage collections, number of young generation garbage collections, and total memory consumption during the execution cycle.
[0150] For example, if the processData function starts executing at 10:00:00 am and ends executing at 10:00:30 am, then the difference between the execution end time and the execution start time can be used to determine that the execution time of the processData function is 30 seconds.
[0151] For example, if the first full garbage collection number is 100 when the processData function starts executing, and the second full garbage collection number of the system is 105 when the processData function ends executing, then through the difference between the second full garbage collection number and the first full garbage collection number, it can be calculated that the system performed 5 full garbage collections during the execution cycle of the processData function.
[0152] For example, if the number of first-generation garbage collections is 500 when the processData function starts executing, and the number of second-generation garbage collections is 520 when the processData function ends executing, then through the difference between the number of second-generation garbage collections and the number of first-generation garbage collections, it can be calculated that during the execution cycle of the processData function, the system performed 20 young-generation garbage collections.
[0153] For example, if when the processData function starts executing, the first memory amount of 200MB is allocated to the target thread executing the function, and when the processData function ends executing, the second memory amount of 250MB is allocated to the target thread executing the function, then the total memory consumption of the target thread is the difference between the second memory amount and the first memory amount, which is 50MB.
[0154] Through these methods, you can accurately measure the execution performance and resource consumption of the target function and generate multiple performance metrics. This data provides in-depth insights into the target function's efficiency and memory usage, helping you accurately and quickly identify performance bottlenecks, optimize memory management, and prevent memory leaks and other memory anomalies.
[0155] Step 106 : Obtain the over-limit threshold corresponding to each performance operation data, and determine the memory abnormal data detection result of the target memory according to the size relationship between each performance operation data and the corresponding over-limit threshold.
[0156] In some embodiments, in order to quickly evaluate whether an abnormality occurs in the target memory through multiple performance operation data, the multiple performance operation data obtained by continuous monitoring can be compared with the over-limit threshold to determine the size relationship between the multiple performance operation data and their respective corresponding over-limit thresholds, thereby achieving automatic, accurate and intelligent evaluation of the abnormality of the target memory.
[0157] The exceeding threshold may be a preset maximum allowable value of a performance operation data. When the actual monitored performance operation data exceeds the threshold, the system will consider that there is a potential performance problem or memory anomaly.
[0158] The memory abnormality data detection result may be a conclusion obtained by comparing the performance operation data with the corresponding over-limit threshold.
[0159] In some embodiments, the performance operation data may include the execution time of the target execution function, the number of full garbage collections within the execution cycle of the target execution function, the number of young generation garbage collections, and the total execution memory consumption; the over-limit thresholds may include the execution time threshold, the average memory application rate threshold, the memory consumption threshold, the full garbage collection number threshold, and the young generation garbage collection number threshold.
[0160] Furthermore, by comparing the performance data with the corresponding over-limit threshold, it is possible to determine whether the performance data is normal. For example, if the performance data is total execution memory usage, the corresponding over-limit threshold is the memory consumption threshold. If the total execution memory usage is 100MB and the memory consumption threshold is 200MB, since 100MB is less than 200MB, the target memory does not exhibit abnormalities in terms of total execution memory usage.
[0161] In some embodiments, the memory abnormality data detection result of the target memory can be obtained based on the relationship between multiple performance operation data and corresponding over-limit thresholds. For example, if any performance operation data is greater than the corresponding over-limit threshold, the memory abnormality data detection result can be obtained as abnormal.
[0162] In an embodiment of the present application, in response to a memory abnormality data detection instruction, a pre-injected memory abnormality detection data packet is executed; wherein the memory abnormality detection data packet is used to detect the usage of the target memory; in response to a pending request, at least one target class object is loaded according to the pending request; a plurality of to-be-executed functions contained in the currently loaded at least one target class object are determined, and each to-be-executed function is matched through a plurality of function interception strategies of a preset plurality of task execution entries to obtain a matching result; when the matching result indicates that there is at least one target execution function among the plurality of to-be-executed functions that matches the function interception strategy of at least one task execution entry, a detection logic function is injected before and after the execution logic of the at least one target execution function; through the detection logic function, a plurality of performance operation data corresponding to the execution of the at least one target execution function is obtained, wherein each performance operation data is associated with the memory usage of the target memory when the at least one target execution function is executed; an over-limit threshold corresponding to each performance operation data is obtained, and the memory abnormality data detection result of the target memory is determined based on the size relationship between each performance operation data and the corresponding over-limit threshold. In this way, the memory usage of the entire process of executing the target execution function can be actively detected through the pre-injected memory anomaly detection data packet. Specifically, the present application can locate the memory detection to the function level, and by matching the interception strategy for each function to be executed, no function that needs to be focused on is missed, and the function that needs to be focused on can be accurately located; further, by injecting the detection logic function before and after the execution logic of the successfully matched target execution function, the performance operation data of the successfully matched target execution function can be detected before the request is processed and after the processing is completed, so as to ensure that all memory usage can be captured in time and accurately detected, and no key events will be missed; finally, by comparing the size relationship between the performance operation data obtained by detection and the over-limit threshold, it can be ensured that an abnormal event can be quickly discovered once it occurs, reducing the time delay from the occurrence of the problem to the detection of the problem, and improving the accuracy of memory detection. In summary, the present application can improve the timeliness and accuracy of memory abnormality data detection.
[0163] In some embodiments, the plurality of performance operation data includes the execution time of the target execution function, the number of full garbage collections within the execution cycle of the target execution function, the number of young generation garbage collections, and the total execution memory consumption. The over-limit threshold includes the execution time threshold, the average memory application rate threshold, the memory consumption threshold, the full garbage collection number threshold, and the young generation garbage collection number threshold. In some embodiments, in order to improve the accuracy of anomaly detection, the target memory usage can be comprehensively evaluated by integrating the size comparison results of multiple dimensions to improve the reliability and accuracy of the detection results. For example, step 106 can include:
[0164] (106.1) Calculate the average memory request rate of the target execution function based on the ratio of the total execution memory consumption to the execution time;
[0165] (106.2) Obtain a first detection sub-result based on a first comparison result obtained by comparing the execution time with the execution time threshold, and a second comparison result obtained by comparing the average memory request rate with the average memory request rate threshold;
[0166] (106.3) Obtaining a second detection sub-result based on a magnitude relationship between the total execution memory consumption and the memory consumption threshold;
[0167] (106.4) Combining a third comparison result obtained based on the relationship between the number of complete garbage collections and the threshold number of complete garbage collections with the second detection sub-result to obtain a third detection sub-result;
[0168] (106.5) Combining a fourth comparison result obtained based on the relationship between the number of young generation garbage collections and the threshold number of young generation garbage collections with the second detection sub-result to obtain a fourth detection sub-result;
[0169] (106.6) Determine a memory exception data detection result of the target execution function based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result.
[0170] The average memory allocation rate can be the average amount of memory allocated per unit time (e.g., milliseconds) during the execution of the target function. The average memory allocation rate can be calculated as the ratio of the execution duration to the total execution memory consumption.
[0171] Among them, the first comparison result can be a result obtained based on the size relationship between the execution time of the target execution function and the preset execution time threshold. The first comparison result can be that the execution time is greater than the exceeding threshold or the execution time is less than the exceeding threshold.
[0172] Among them, the second comparison result can be a result obtained based on the size relationship between the average memory application rate of the target execution function and the preset average memory application rate threshold. The second comparison result can be that the average memory application rate is less than the average memory application rate threshold, or the average memory application rate is greater than the average memory application rate threshold.
[0173] The first detection sub-result may be a preliminary detection result obtained by combining the first comparison result and the second comparison result. The first detection sub-result is abnormal only when both the first comparison result and the second comparison result are abnormal, otherwise it is normal.
[0174] Among them, the second detection sub-result can be a result obtained based on the size relationship between the total execution memory consumption of the target execution function and the preset memory consumption threshold. When the total execution memory consumption is greater than the memory consumption threshold, the second detection sub-result is "abnormal", otherwise it is "normal".
[0175] Among them, the third comparison result can be a result obtained based on the size relationship between the number of complete garbage collections of the target execution function and a preset complete garbage collection number threshold. When the number of complete garbage collections exceeds the complete garbage collection number threshold, the third comparison result is "greater than"; otherwise it is "less than".
[0176] The third detection sub-result may be a further detection result derived by combining the third comparison result and the second detection sub-result. When the third comparison result indicates that the number of complete garbage collections exceeds the complete garbage collection threshold, and the second detection sub-result is "abnormal," the third detection sub-result is "abnormal," otherwise, it is "normal."
[0177] The fourth comparison result may be a result obtained based on a relationship between the number of young generation garbage collections of the target execution function and a preset young generation garbage collection number threshold. If the number of young generation garbage collections is greater than the young generation garbage collection number threshold, the fourth comparison result is "greater than"; otherwise, the fourth comparison result is "less than."
[0178] The fourth detection sub-result may be a further detection result obtained by combining the fourth comparison result and the second detection sub-result. When the fourth comparison result indicates that the number of young generation garbage collections exceeds the young generation garbage collection number threshold, and the second detection sub-result is "abnormal," the fourth detection sub-result is "abnormal," otherwise, the fourth detection sub-result is "normal."
[0179] In some embodiments, when the memory exception data detection result of the target execution function is finally determined based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result, if any one of the detection sub-results is "abnormal", the memory exception data detection result is "abnormal"; otherwise, it is "normal".
[0180] Exemplarily, if the target execution function is processData, during the execution of processData, an exception detection is performed on the target memory.
[0181] Furthermore, we can assume that the processData function consumes 500MB of memory during execution and takes 100 milliseconds to execute. Then the average memory request rate is 500MB / 100ms = 5MB / ms.
[0182] For example, when calculating the first detection sub-result, if the execution time threshold is set to 150 milliseconds and the average memory request rate threshold is set to 6 MB / ms, then if 100 ms < 150 ms, the first comparison result is normal for the execution time. If 5 MB / ms < 6 MB / ms, the second comparison result is normal for the average memory request rate. If both the first and second comparison results are normal, then the first detection sub-result is "normal."
[0183] For example, when calculating the second detection sub-result, if the memory consumption threshold is set to 450MB, and the total execution memory consumption is 500MB>450MB, which exceeds the memory consumption threshold, the second detection sub-result is "abnormal".
[0184] For example, when calculating the third sub-detection result, if the threshold for the number of complete garbage collections is set to 3, and 4 complete garbage collections occur during the execution of the processData function, 4 > 3, and the third comparison result indicates that the number of complete garbage collections exceeds the threshold. Because the number of complete garbage collections exceeds the threshold and the second sub-detection result is "abnormal," the third sub-detection result is also "abnormal."
[0185] For example, when calculating the fourth detection sub-result, if the threshold value of the number of young generation garbage collections is set to 10 times, 8 young generation garbage collections occurred during the execution of the processData function, 8 times < 10 times, and the fourth comparison result indicates that the number of young generation garbage collections did not exceed the threshold. Although the second detection sub-result was "abnormal", the fourth detection sub-result was "normal".
[0186] In summary, the first detection sub-result is normal, the second detection sub-result is abnormal, the third detection sub-result is abnormal, and the fourth detection sub-result is normal, so the final memory abnormal data detection result is "abnormal".
[0187] In some embodiments, the specific values of the over-limit thresholds (including execution time threshold, average memory application rate threshold, memory consumption threshold, full garbage collection number threshold and young generation garbage collection number threshold, etc.) can be adjusted and updated according to actual conditions.
[0188] By comprehensively considering multiple dimensions such as total execution memory consumption, execution time, average memory request rate, number of full garbage collections, and number of young generation garbage collections, and comparing them with corresponding thresholds, it is possible to accurately detect abnormal memory usage of the target execution function, thereby effectively identifying and locating potential memory problems, improving the reliability of detection results, and enhancing system stability and performance.
[0189] In some implementations, in order to reduce invalid alarms, it is possible to set the measurement to be ignored, and to ignore irrelevant monitoring and alarms, so as to improve the efficiency and accuracy of problem location. For example, the memory abnormal data detection method may also include:
[0190] (B.1) obtaining a uniform resource locator associated with the pending request, and searching the ignore policy table based on the uniform resource locator to obtain a search result;
[0191] (B.2) When the search result indicates that the pending request corresponds to at least one performance ignore item, the performance ignore item is marked in at least one target execution function corresponding to the pending request so that the size relationship between the target performance operation data corresponding to the performance ignore item and the corresponding over-limit threshold is ignored when determining the memory anomaly data detection result of the target memory.
[0192] Among them, the Uniform Resource Locator (URL) is an address identifier pointing to a specific resource on the Internet, which can be used to uniquely identify a Web service endpoint or API interface.
[0193] The search result may be a result obtained by performing a matching search in a preset ignore strategy table based on the URL associated with the pending request. If a performance ignore item corresponding to the URL is found, the search result may be a hit, otherwise a miss.
[0194] Among them, the performance ignore item can be performance operation data that should not be included in the memory abnormal data detection range under specific circumstances. The performance operation data has been expanded above and will not be repeated here.
[0195] In some embodiments, for API endpoints that have large performance fluctuations due to business logic or external factors, such as traffic surges during promotional activities, an ignore strategy can be set to avoid triggering false alarms during these known high-pressure periods. Alternatively, in the development and testing environment, there may be some temporary performance issues or anomalies that will not occur in the production environment. In this case, an ignore strategy can be set to avoid interfering with the development and testing process. Alternatively, for API endpoints that have little impact on the business, even if their performance occasionally exceeds the normal range, they can be ignored to concentrate resources on monitoring those parts that have a greater impact on the business. Alternatively, for known technical debts, that is, performance issues that have been identified but not yet resolved, if they cause a surge in total execution memory consumption during operation, an ignore strategy for total execution memory consumption can be set until the problem is resolved, and so on. It should be noted that the ignore strategy can be set according to actual conditions without violating the concept of the present application.
[0196] For example, a web application has a specific API endpoint, / data, where users can send pending requests (e.g., HTTP requests) to retrieve data. The backend code for this API endpoint contains a key function, processData(), responsible for processing pending requests and returning data. When a user sends a pending request to / data, the system retrieves the Uniform Resource Locator (URL) of the pending request, namely / data, and searches the ignore policy table for performance ignore entries related to / data based on the URL.
[0197] Furthermore, if the search results find that / data corresponds to a performance ignore item, the performance ignore item specifies that when processing the / data request, the memory usage of the processData() function can be ignored, even if it exceeds the corresponding memory consumption threshold.
[0198] Furthermore, the system can mark this performance ignore item in the processData() function, which means that in the subsequent memory anomaly data detection process, the system will ignore the abnormal changes caused by the total execution memory consumption, will not regard this limit exceeding as an anomaly, and will not trigger related alarms or performance optimization measures.
[0199] Through the above methods, the system can intelligently filter performance ignore items associated with specific URLs, effectively avoiding false positives in memory anomaly data detection, reducing unnecessary performance optimization measures and alarms, thereby improving the accuracy and efficiency of the monitoring system, ensuring that action is only taken when actual memory anomalies occur, and optimizing resource allocation and system response.
[0200] In some implementations, to optimize the memory usage efficiency of an application, the memory allocation changes of each target execution function when processing requests can be accurately monitored and analyzed to identify functions with abnormal memory consumption, thereby implementing function-level optimization to achieve application slimming effects. For example, the memory abnormality data detection method may also include:
[0201] (C.1) obtaining a memory change magnitude of memory allocated to a target thread of each target execution function when each target execution function is called; wherein the memory change magnitude is calculated as the difference between a maximum memory amount and a minimum memory amount allocated to a target thread of each target execution function during processing of each target execution function;
[0202] (C.2) obtaining a preset amplitude threshold, and comparing the memory change amplitude with the preset amplitude threshold to obtain an amplitude comparison result;
[0203] (C.3) When the amplitude comparison result indicates that the number of times the memory change amplitude exceeds the preset amplitude is less than the preset number, the logic code of the target execution function is modified to reduce the memory change amplitude when the target execution function processes any pending request.
[0204] The memory variation range may refer to the difference between the maximum amount of memory and the minimum amount of memory allocated to the target thread of each target execution function during the processing of each target execution function.
[0205] The preset amplitude threshold may be a preset maximum allowable memory change amplitude value. When the actual monitored memory change amplitude exceeds the preset amplitude threshold, the system will consider that there is a potential memory management problem or performance bottleneck.
[0206] The amplitude comparison result may be a result obtained based on the magnitude relationship between the memory change amplitude and a preset amplitude threshold.
[0207] For example, if a Java application includes a target execution function processData() for processing large amounts of data analysis, when processData() is called, the Java Agent starts to monitor the memory allocation of processData().
[0208] If the playback data during the execution of the target execution function recorded in the early warning module is used, the monitoring records obtained indicate that during the processing, the maximum amount of memory allocated to the target thread of processData() is 300MB, and the minimum amount of memory is 50MB. Therefore, the memory change range is calculated as 300MB-50MB=250MB.
[0209] For example, if the preset amplitude threshold is 200MB, the actual monitored memory change amplitude of 250MB is compared with the preset amplitude threshold of 200MB. The comparison result can indicate that the memory change amplitude exceeds the preset amplitude threshold. At this time, the logic code of processData() can be modified to reduce the memory change amplitude when the target execution function processes any pending request.
[0210] In some embodiments, the function execution cycle of the target execution function can be divided to obtain multiple sub-cycle durations, and in each sub-cycle duration, the difference between the maximum memory amount and the minimum memory amount allocated to the target thread of the target execution function is obtained, and the multiple memory change amplitudes corresponding to the multiple sub-cycle durations are respectively compared with the preset amplitude threshold to obtain multiple amplitude comparison results, and when the amplitude comparison result indicates that the number of times the memory change amplitude exceeds the preset amplitude is less than the preset number, for example, the preset number of times is 2 times, and there are 3 amplitude comparison results indicating that the number of times the memory change amplitude exceeds the preset amplitude is less than the preset number, the logic code of the target execution function can be modified to reduce the memory change amplitude when the target execution function processes any pending request. Furthermore, the preset number of times can be set according to actual conditions, for example, 1, 3, 4, etc., and the embodiments of the present application do not make specific restrictions on this.
[0211] In some embodiments, when modifying and optimizing the logic code of the target execution function to reduce the amplitude of memory changes, the target execution function can be analyzed first. If the analysis results show that there is a large temporary array in the target execution function, and the array occupies a large amount of memory during the processing, then the code can be optimized by using a more efficient data structure, such as using ArrayList instead of an array, to dynamically adjust the size and reduce memory waste. Alternatively, the purpose of optimizing the logic code can be achieved by reducing the creation of unnecessary temporary objects, such as by reusing objects or using object pools to reduce memory allocation. Alternatively, the memory usage can be reduced by reducing the number of loops or optimizing conditional judgments to reduce unnecessary memory usage, etc.
[0212] Through the above methods, potential memory management problems or performance bottlenecks can be effectively identified. By optimizing code logic, such as using more efficient data structures, reducing temporary object creation, optimizing loops and conditional judgments, etc., memory consumption can be effectively reduced, application performance can be improved, and garbage collection pressure can be reduced, thereby achieving memory reduction and performance optimization of the application.
[0213] In some embodiments, in order to achieve real-time monitoring and anomaly detection of target memory usage, the detection data can be temporarily stored in the information storage module during the execution of the target execution function. After the execution is completed, the detection data is transferred to the early warning module to reduce the impact on the execution performance of the target thread, ensure the lightweight and efficient monitoring process, and achieve efficient and accurate analysis of anomalies. For example, the memory anomaly data detection method can also include:
[0214] (D.1) Storing detection data generated during the execution of a target execution function within a function execution cycle in an information storage module of a target memory, and after the target execution function is completed, transmitting the detection data to an early warning module located relative to the target memory; wherein the detection data includes detection metadata generated by the task execution entry for the target execution function, playback data during the execution of the target execution function, and multiple performance operation data; the early warning module is separate from the target thread that processes the target execution function;
[0215] (D.2) When the memory anomaly data detection result indicates that the target memory usage is abnormal, replay data is obtained from the early warning module;
[0216] (D.3) Based on the playback data, analyze the cause of the abnormality of the target memory and obtain the abnormality cause analysis result.
[0217] The information storage module can be a data storage component that stores various detection data generated in real time for the target execution function during the function execution cycle. The detection data includes but is not limited to detection metadata generated at the task execution entry, playback data during the execution of the target execution function, and multiple performance operation data.
[0218] Among them, the early warning module can be a component that runs independently of the target memory and target thread, responsible for receiving the detection data transmitted from the information storage module. The early warning module can be set in a persistent storage, such as a file system or database, to avoid occupying the target memory and affecting the system performance.
[0219] The replay data may be a series of detailed operation logs or status snapshots collected during the execution cycle of the target function, which can be used to reproduce the specific process of function execution.
[0220] Among them, the abnormal cause analysis results can be based on playback data and other relevant detection data, and the results are obtained after in-depth analysis of the target memory usage through specific algorithms or tools. The abnormal cause analysis results can include the specific abnormal cause, possible impact range and recommended solutions.
[0221] For example, if the target execution function is placeOrder(), when the placeOrder() function is called, Java Agent or similar monitoring tools begin to collect detection data about the execution of the placeOrder() function, including the function's call parameters (detection metadata), memory allocation and release during execution (playback data), as well as performance data such as execution time and garbage collection times, and temporarily store the collected detection data in the information storage module of the target memory. Once the placeOrder() function is executed, all detection data is transmitted to the early warning module, which runs independently of the target thread that processes placeOrder() to avoid interfering with the business process.
[0222] In some embodiments, if after the target execution function is executed, the memory exception data detection result indicates that there is an abnormality in the usage of the target memory, then after an alarm is issued, the technician can analyze the execution process of the target execution function based on the playback data of the target execution function provided by the early warning module, including function parameters, memory allocation details, etc., to identify the specific cause of the memory exception, such as unnecessary object creation or memory leak in a certain loop, so as to respond quickly when the memory exception occurs and reduce the risk of system failure.
[0223] Through the above method, the early warning module can be separated from the business thread, reducing the impact of monitoring on business performance and ensuring the smooth execution of business processes. This storage method is particularly important during high load or critical business periods. At the same time, storing playback data in the early warning module can help quickly locate the cause of memory anomalies and reduce the problem of system crashes or performance degradation caused by memory anomalies.
[0224] See also Figure 3 The embodiment of the present application further provides a memory abnormal data detection device, which can implement the above-mentioned memory abnormal data detection method. The memory abnormal data detection device includes:
[0225] A response module 31 is configured to execute a pre-injected memory anomaly detection data packet in response to a memory anomaly data detection instruction; wherein the memory anomaly detection data packet is configured to detect usage of a target memory;
[0226] A loading module 32, configured to respond to a pending request and load at least one target class object according to the pending request;
[0227] A matching module 33 is configured to determine multiple to-be-executed functions contained in at least one currently loaded target class object, and match each to-be-executed function using multiple function interception strategies of multiple preset task execution entrances to obtain a matching result;
[0228] The injection module 34 is configured to inject a detection logic function before or after the execution logic of the at least one target execution function when the matching result indicates that there is at least one target execution function among the multiple functions to be executed that matches the function interception strategy of at least one task execution entry;
[0229] an acquisition module 35 for acquiring, by detecting a logic function, a plurality of performance operation data corresponding to the execution of at least one target execution function, wherein each performance operation data is associated with a memory usage of a target memory when the at least one target execution function is executed;
[0230] The determination module 36 is used to obtain the over-limit threshold corresponding to each performance operation data, and determine the memory abnormal data detection result of the target memory according to the size relationship between each performance operation data and the corresponding over-limit threshold.
[0231] The specific implementation of the memory abnormal data detection device is basically the same as the specific embodiment of the memory abnormal data detection method described above, and will not be repeated here. Under the premise of meeting the requirements of the embodiment of the present application, the memory abnormal data detection device can also be provided with other functional modules to implement the memory abnormal data detection method in the above embodiment.
[0232] The present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned abnormal memory data detection method. The computer device can be any intelligent terminal including a tablet computer, an in-vehicle computer, or the like.
[0233] See also Figure 4 , Figure 4 The hardware structure of a computer device according to another embodiment is shown. The computer device includes:
[0234] The processor 41 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0235] The memory 42 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 42 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 42, and the processor 41 calls and executes the memory abnormality data detection method of the embodiments of this application;
[0236] Input / output interface 43, used for information input and output;
[0237] Communication interface 44, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.);
[0238] bus 45 , which transmits information between the various components of the device (e.g., processor 41 , memory 42 , input / output interface 43 , and communication interface 44 );
[0239] The processor 41 , the memory 42 , the input / output interface 43 and the communication interface 44 are connected to each other in communication within the device via a bus 45 .
[0240] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned memory abnormal data detection method is implemented.
[0241] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0242] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0243] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0244] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0245] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0246] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0247] It should be understood that in this application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0248] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0249] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0250] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0251] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.
[0252] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A method for detecting abnormal data in memory, characterized in that: The method comprises: In response to the memory abnormality data detection instruction, running a pre-injected memory abnormality detection data packet; wherein the memory abnormality detection data packet is used to detect the usage of the target memory; Responding to a pending request, and loading at least one target class object according to the pending request; Determine multiple to-be-executed functions contained in the at least one target class object currently loaded, and match each to-be-executed function using multiple function interception strategies of multiple preset task execution entrances to obtain a matching result; When the matching result indicates that there is at least one target execution function among the multiple functions to be executed that matches the function interception strategy of at least one task execution entry, injecting a detection logic function before and after the execution logic of the at least one target execution function; Acquire, by the detection logic function, a plurality of performance operation data corresponding to when executing the at least one target execution function, wherein each performance operation data is associated with a memory usage of the target memory when executing the at least one target execution function; Obtain the over-limit threshold corresponding to each performance operation data, and determine the memory abnormality data detection result of the target memory based on the size relationship between each performance operation data and the corresponding over-limit threshold, wherein the multiple performance operation data include the execution time of the target execution function, the number of complete garbage collections within the execution cycle of the target execution function, the number of young generation garbage collections, and the total execution memory consumption, and the over-limit threshold includes the execution time threshold, the average memory application rate threshold, the memory consumption threshold, the number of complete garbage collections threshold and the number of young generation garbage collections threshold.
2. The memory abnormal data detection method according to claim 1, characterized in that: The multiple performance operation data include the execution time of the target execution function, the number of complete garbage collections and the number of young generation garbage collections within the execution cycle of the target execution function, and the total execution memory consumption. The acquisition of the multiple performance operation data corresponding to the execution of the at least one target execution function by the detection logic function includes: Obtaining, by means of the detection logic function, an execution start time and an execution end time of the at least one target execution function, and determining an execution duration of the at least one target execution function based on the execution start time and the execution end time; Obtaining a first complete garbage collection count of the system at the start of execution of the at least one target execution function and a second complete garbage collection count of the system at the end of execution of the at least one target execution function, and determining a number of complete garbage collections within an execution cycle of the at least one target execution function based on the first complete garbage collection count and the second complete garbage collection count; Obtaining a first young generation garbage collection count of the system at the start of execution of the at least one target execution function and a second young generation garbage collection count of the system at the end of execution of the at least one target execution function, and determining a young generation garbage collection count within an execution cycle of the at least one target execution function based on the first young generation garbage collection count and the second young generation garbage collection count; Obtain a first memory amount allocated to the target thread executing the at least one target execution function at the beginning of execution of the at least one target execution function, and a second memory amount allocated to the target thread executing the at least one target execution function at the end of execution of the at least one target execution function, and determine the total execution memory consumption within the execution cycle of the at least one target execution function based on the difference between the second memory amount and the first memory amount.
3. The memory abnormal data detection method according to claim 1, characterized in that: The determining, based on a magnitude relationship between each performance operation data and the corresponding over-limit threshold, a memory abnormality data detection result of the target memory includes: Calculating an average memory request rate of the target execution function based on a ratio of the total execution memory consumption to the execution time; Obtaining a first detection sub-result based on a first comparison result obtained by comparing the execution time with the execution time threshold, and a second comparison result obtained by comparing the average memory request rate with the average memory request rate threshold; Obtaining a second detection sub-result based on a magnitude relationship between the total execution memory consumption and the memory consumption threshold; combining a third comparison result obtained based on the magnitude relationship between the number of complete garbage collections and the threshold number of complete garbage collections with the second detection sub-result to obtain a third detection sub-result; Combining a fourth comparison result obtained based on the magnitude relationship between the number of young generation garbage collection times and the threshold number of young generation garbage collection times with the second detection sub-result to obtain a fourth detection sub-result; A memory abnormal data detection result of the target execution function is determined based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result.
4. The memory abnormal data detection method according to claim 1, characterized in that: The method further comprises: When it is necessary to ignore the memory usage when calling the first to-be-executed function, add an ignore annotation to the first to-be-executed function; When the first to-be-executed function matches the function interception strategy corresponding to any of the task execution entries, a detection logic function is not injected before or after the execution logic of the first to-be-executed function.
5. The memory abnormal data detection method according to claim 1, characterized in that: The method further comprises: Obtaining a uniform resource locator associated with the pending request, and searching in an ignore policy table based on the uniform resource locator to obtain a search result; When the search result indicates that the pending request corresponds to at least one performance ignore item, the performance ignore item is marked in at least one target execution function corresponding to the pending request so as to ignore the size relationship between the target performance operation data corresponding to the performance ignore item and the corresponding over-limit threshold when determining the memory abnormality data detection result of the target memory.
6. The memory abnormal data detection method according to claim 1, characterized in that: The method further comprises: Obtaining a memory change range of the amount of memory allocated to the target thread of each target execution function when calling each target execution function; wherein the memory change range is calculated by the difference between the maximum amount of memory allocated to the target thread of each target execution function during the processing of each target execution function and the minimum amount of memory allocated; Obtaining a preset amplitude threshold, and comparing the memory change amplitude with the preset amplitude threshold to obtain an amplitude comparison result; When the amplitude comparison result indicates that the number of times the memory change amplitude exceeds the preset amplitude is less than the preset number, the logic code of the target execution function is modified to reduce the memory change amplitude when the target execution function processes any pending request.
7. The memory abnormal data detection method according to claim 1, characterized in that: The method further comprises: Storing detection data generated when executing the target execution function within a function execution cycle in an information storage module of the target memory, and transmitting the detection data to an early warning module set relative to the target memory after the target execution function is executed; wherein the detection data includes detection metadata generated by the task execution entry for the target execution function, playback data during the execution of the target execution function, and the plurality of performance operation data; the early warning module is separated from the target thread that processes the target execution function; When the memory abnormality data detection result indicates that the usage of the target memory is abnormal, replay data is obtained from the early warning module; Based on the playback data, an abnormality cause analysis is performed on the target memory to obtain an abnormality cause analysis result.
8. A memory abnormal data detection device, characterized in that: The device comprises: A response module, configured to execute a pre-injected memory anomaly detection data packet in response to a memory anomaly data detection instruction; wherein the memory anomaly detection data packet is used to detect the usage of the target memory; A loading module, configured to respond to a pending request and load at least one target class object according to the pending request; a matching module, configured to determine a plurality of to-be-executed functions contained in the at least one target class object currently loaded, and match each to-be-executed function using a plurality of function interception strategies of a plurality of preset task execution entrances to obtain a matching result; an injection module, configured to, when the matching result indicates that there is at least one target execution function among the multiple functions to be executed that matches the function interception strategy of at least one task execution entry, inject a detection logic function before or after the execution logic of the at least one target execution function; an acquisition module, configured to acquire, through the detection logic function, a plurality of performance operation data corresponding to the execution of the at least one target execution function, wherein each performance operation data is associated with a memory usage of the target memory when the at least one target execution function is executed; A determination module is used to obtain the over-limit threshold corresponding to each performance operation data, and determine the memory abnormality data detection result of the target memory based on the size relationship between each performance operation data and the corresponding over-limit threshold, wherein the multiple performance operation data include the execution time of the target execution function, the number of complete garbage collections and the number of young generation garbage collections within the execution cycle of the target execution function, and the total execution memory consumption, and the over-limit threshold includes the execution time threshold, the average memory application rate threshold, the memory consumption threshold, the number of complete garbage collections threshold and the number of young generation garbage collections threshold.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the memory abnormal data detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting abnormal memory data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Performance detection method and device for heterogeneous acceleration program and storage medium
CN116126669A
Memory exception detection method and device and computer readable storage medium
CN117555709A