Memory abnormal data detection method and device, computer equipment and storage medium

By injecting memory exception detection packets and function interception strategies into the JVM, real-time monitoring and early warning of JVM memory exceptions, the problem of untimely and inaccurate memory exception detection in the existing technology is solved, and the timeliness and accuracy of detection is improved.

CN119917328AActive Publication Date: 2025-05-02云和恩墨(北京)信息技术有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411993025.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The prior art is difficult to detect memory exception data in Java virtual machines (JVMs) in a timely and accurate manner, resulting in application performance degradation or service interruption.

Method used

By running the pre-injected memory exception detection packet, loading the target class object in response to the pending request, and matching the injection detection logic function through the function interception strategy, obtaining performance run data to determine the memory exception data detection result.

Benefits of technology

Real-time monitoring and early warning of JVM memory usage is realized, the timeliness and accuracy of memory exception data detection is improved, and the time delay from the occurrence of a problem to the detection of problems is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917328A_ABST
    Figure CN119917328A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory abnormal data detection method and device, computer equipment and a storage medium. In response to the memory abnormal data detection instruction, running a memory abnormal detection data packet; loading at least one target class object according to the to-be-processed request, determining a plurality of to-be-executed functions, and matching each to-be-executed function through a plurality of function interception strategies of a plurality of preset task execution entries to obtain a matching result; when a target execution function in the to-be-executed functions is matched with the function interception strategy of the task execution entry, injecting a detection logic function before and after the execution logic of the corresponding target execution function; and obtaining a plurality of corresponding performance operation data when the at least one target execution function is executed by detecting the logic function, and determining a memory abnormal data detection result according to a size relationship between each piece of performance operation data and the corresponding over-limit threshold. Therefore, the timeliness and accuracy of memory abnormal data detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a method, device, 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 the differences in the underlying hardware and operating system, simplifying the development process and reducing maintenance costs. However, in actual applications, if the program fails to manage memory correctly, or the memory requested by the program exceeds the memory size that the JVM can provide, it will cause memory leaks or memory overflow problems. These problems will gradually consume available memory resources, eventually causing a significant drop in application performance, prolonged response time, and even service interruptions or system crashes in severe cases. Therefore, timely and effective memory detection is essential to ensure the stability and reliability of the JVM.

[0003] In the related art, the JVM memory is usually tested regularly through detection tools (such as jstat and jcmd, etc.) to output the performance statistics of the JVM at a specified time interval, and generate a performance report through the performance statistics to help technicians understand the operation of the JVM. However, this solution can only collect data at a predetermined time point, and events that occur at non-detection time points will not be recorded. As a result, it is 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 data in memory, which can improve the timeliness and accuracy of abnormal data detection in memory.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for detecting abnormal data in a memory, the method comprising:

[0006] In response to the memory abnormality data detection instruction, a pre-injected memory abnormality detection data packet is run; wherein the memory abnormality detection data packet is used to detect the usage of the target memory;

[0007] Responding to the pending request, and loading at least one target class object according to the pending request;

[0008] 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;

[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 means of 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 value 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 value.

[0012] Accordingly, a second aspect of an embodiment of the present application provides a memory abnormal data detection device, the device comprising:

[0013] A response module, configured to respond to a memory abnormality data detection instruction and execute 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;

[0014] A loading module, used to respond to the pending request and load at least one target class object according to the pending request;

[0015] A matching module, used 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 through 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 inject a detection logic function before or after the execution logic of 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;

[0017] an acquisition module, configured to acquire, through the detection logic function, a plurality of performance operation data corresponding to when the at least one target execution function is executed, 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 according to the size relationship between each performance operation data and the corresponding over-limit threshold.

[0019] In some implementations, the plurality of 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 acquisition module is further used 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 number of the system when the execution of the at least one target execution function starts, and a second complete garbage collection number of the system when the execution of the at least one target execution function ends, and determining a complete garbage collection number within an execution cycle of the at least one target execution function based on the first complete garbage collection number and the second complete garbage collection number;

[0022] Obtaining a first young generation garbage collection number of the system at the start of execution of the at least one target execution function and a second young generation garbage collection number of the system at the end of execution of the at least one target execution function, and determining a young generation garbage collection number within an execution cycle of the at least one target execution function based on the first young generation garbage collection number and the second young generation garbage collection number;

[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 implementations, the plurality of performance operation data include the execution time of the target execution function, the number of complete garbage collections, the number of young generation garbage collections, and the total execution memory consumption within the execution cycle of the target execution function, and the over-limit threshold includes an execution time threshold, an average memory application rate threshold, a memory consumption threshold, a complete garbage collection number threshold, and a young generation garbage collection number threshold; the determination module is further used to:

[0025] The determining 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 value includes:

[0026] Calculating the average memory request rate of the target execution function according to the 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 based on a size relationship between the execution time and the execution time threshold, and a second comparison result obtained based on a comparison between the average memory application rate and the average memory application rate threshold;

[0028] Based on the magnitude relationship between the total execution memory consumption and the memory consumption threshold, obtaining a second detection sub-result;

[0029] 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 is combined with the second detection sub-result to obtain a third detection sub-result;

[0030] 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 is combined with the second detection sub-result to obtain a fourth detection sub-result;

[0031] Based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result, a memory abnormal data detection result of the target execution function is determined.

[0032] In some implementations, the memory abnormal data detection device further includes an adding module, which is used to:

[0033] When it is necessary to ignore the memory usage when calling the first to-be-executed function, adding an ignore annotation to the first to-be-executed function;

[0034] When the first function to be executed 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 function to be executed.

[0035] In some implementations, the memory abnormal data detection device further includes a search module, which is used to:

[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 represents 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 implementations, the memory abnormal data detection device further includes a comparison module, which is used to:

[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;

[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 implementations, the memory abnormal data detection device further includes an analysis module, which is used to:

[0043] The detection data when the target execution function is executed within the function execution cycle is stored in the information storage module of the target memory, and after the target execution function is executed, the detection data is transmitted to the early warning module set relative to the target memory; wherein the detection data includes the detection metadata generated by the task execution entry for the target execution function, the playback data during the execution of the target execution function, and the multiple performance operation data; the early warning module is separated from the target thread processing 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 the processor implements the memory abnormal data detection method described in any one of the embodiments of the first aspect of the present application when executing the computer program.

[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 pending functions contained in the currently loaded at least one target class object are determined, and each pending function is matched through a plurality of function interception strategies of a plurality of preset 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 pending 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 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 according to 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 the detection and the over-limit threshold, it can be ensured that the 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 It is a schematic diagram of the architecture of the memory abnormal data detection system provided in an embodiment of the present application;

[0050] Figure 2 is a flow chart of a method for detecting abnormal memory data provided by an embodiment of the present application;

[0051] Figure 3 It is a functional module diagram of a memory abnormal data detection device provided in an embodiment of the present application;

[0052] Figure 4 It 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 solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application 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 the differences in the underlying hardware and operating system, simplifying the development process and reducing maintenance costs. However, in actual applications, if the program fails to manage memory correctly, or the memory requested by the program exceeds the memory size that the JVM can provide, it will cause memory leaks or memory overflow problems. These problems will gradually consume available memory resources, eventually causing a significant drop in application performance, prolonged response time, and even service interruptions or system crashes in severe cases. Therefore, timely and effective memory detection is essential to ensure the stability and reliability of the JVM.

[0057] In the related art, the JVM memory is usually tested regularly through detection tools (such as jstat and jcmd, etc.) to output the performance statistics of the JVM at a specified time interval, and generate a performance report through the performance statistics to help technicians understand the operation of the JVM. However, this solution can only collect data at a predetermined time point, and events that occur at non-detection time points will not be recorded. As a result, it is 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 data in memory, which can improve the timeliness and accuracy of abnormal data detection in memory.

[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] Exemplarily, the terminal 11 may be a device that a user interacts with directly, such as a developer's computer, a test machine, or any place where a client application is running. The terminal 11 may provide a user interface (UI) for configuring monitoring policies, viewing alarm information, etc. The terminal 11 may also deploy some lightweight applications or tools for communicating with the server, such as requesting monitoring data or sending control instructions through an application programming interface (API).

[0062] Furthermore, the server 12 may be a computer device for executing business logic and services, and the server 12 may be deployed in a data center or in the cloud. The server 12 may host major application services, including but not limited to a Web server, an application server, etc. At the same time, a Java virtual machine may be deployed on the server 12, and the server 12 may run a Java application to process related requests.

[0063] Exemplarily, the terminal 11 and the server 12 can communicate through a network interface, the terminal 11 can send a request to the server 12, the server 12 processes the corresponding pending request and returns the processing result. Further, in the process of processing the pending request, the server 12 can detect the entire function execution process of the target memory and determine the memory abnormal data detection result of 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 implementation 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 separate 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 separate consent, the necessary user-related data for enabling the normal operation of the embodiment of the present application will be obtained.

[0066] In the embodiment of the present application, the memory abnormal data detection device will be described from the perspective of the memory abnormal data detection device, which can be specifically integrated in a computer device. Figure 2 , Figure 2 This is a flowchart of the steps of the memory abnormal data detection method provided in the embodiment of the present application. The embodiment of the present application takes the memory abnormal data detection device as an example, which is specifically integrated on a terminal or a server. When the processor on the terminal or the 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, execute 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.

[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 abnormal data detection instruction may be a command or signal that triggers the memory detection mechanism to start working. For example, the memory abnormal data detection instruction may be an API call, a specific HyperText Transfer Protocol (HTTP) request, a command line parameter, or may be automatically activated by a condition preset in a certain configuration file. The memory abnormal data detection instruction may be issued by a system administrator, an operation and maintenance personnel, or an automated monitoring script to initiate a detailed inspection of the JVM memory usage.

[0070] The memory anomaly detection data package may be a Java Agent and its associated libraries that include a series of monitoring logics and functions. The memory anomaly detection data package can be seamlessly integrated into a running JVM instance without modifying the original Java application code.

[0071] The target memory may be part of 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 memory resources occupied by different stages of the Java object life cycle and are also the focus of management by the garbage collector.

[0072] In some embodiments, when a memory anomaly 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, a code 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 exception data detection instructions and running pre-injected memory exception detection data packets, developers can be provided with an easy way to quickly diagnose and locate memory-related problems without redeploying the entire application, thereby improving the ease of use and stability of the system.

[0075] Step 102, responding to the request to be processed and loading 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] The pending request may be a specific operation request initiated by the client (which may be a terminal user, other service or automated system) to the server. The pending request may include a Uniform Resource Locator (URL), a requirement to call a specific function or perform a task, such as an HTTP request, a Remote Procedure (RPC) call, a task in a message queue, etc., which is used to instruct 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 the functions and properties to be executed to implement the business logic and can respond to the operation instructions from the pending request.

[0079] In some embodiments, after receiving the pending request on the server side, a router component can be used to determine the backend component corresponding to 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 the memory exception.

[0081] By responding to pending requests and loading target class objects, accurate routing and processing of server-side operation requests are achieved, 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, determining multiple functions to be executed contained in at least one target class object currently loaded, and matching 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 screen out pending functions that require special monitoring, that is, pending functions that may cause target memory exceptions, a preset function interception measurement 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 the target class object, and is a basic unit for actually executing business logic in the 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] The function interception strategy may refer to a set of preset rules or conditions for determining the functions to be executed that need to be intercepted and injected with monitoring logic.

[0087] The matching result can be the result obtained after matching each function to be executed based on the function interception strategy. It refers to the result obtained after comparing the function to be executed with the function interception strategy. Specifically, it indicates whether a specific function meets the given interception condition, thereby determining whether the function will become a monitoring target.

[0088] For example, the function to be executed can be part of the business logic, or it can be a basic service provided by the framework (such as thread pool tasks, scheduled tasks, 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 component in 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] Exemplarily, the function interception strategy can be a class path matching strategy, a method signature matching strategy, an annotation driven strategy, etc. The specific function interception strategy can be defined according to the actual situation, and this application does not make specific restrictions. Taking the class path matching strategy as an example, the function interception strategy of the task execution entry a can be to only intercept 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 only intercept functions named processOrder and whose parameters are OrderDTO objects, etc., which are not listed here one by one.

[0091] In some implementations, the system may automatically allocate a task execution entry corresponding to each function to be executed, etc.

[0092] In some embodiments, when any function to be executed is marked as @Monitor, that is, monitoring is enabled, then 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. On the contrary, when any function to be executed is marked as @Monitor Ignore, that is, monitoring is ignored, then 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 the above manner, excessive monitoring of non-critical methods can be avoided and unnecessary performance overhead can be reduced.

[0093] Exemplarily, the functions to be executed marked as @Monitor can be key business logic functions (such as order processing, payment confirmation, etc.) that directly affect user experience or system stability, functions involving operations such as database access, network requests, file reading and writing that may affect performance, newly developed functional functions, functions that need to run for a long time, etc. The functions to be executed marked as @Monitor Ignore can be simple auxiliary functions, functions with known problems but temporarily unfixable, functions that are frequently called but have low overhead, etc., and the embodiments of the present 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, and the matching result can be obtained as a successful match. 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 need further monitoring. This not only improves the flexibility and accuracy of monitoring, but also supports fine-grained performance management at the function level, thereby improving system stability and user experience.

[0096] Step 104 , when the matching result indicates that among the 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, a detection logic function is injected before or 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 key business logic is fully monitored while reducing unnecessary performance overhead caused by monitoring the execution of non-critical functions.

[0098] The target execution function may be a specific method or function selected from multiple functions to be executed 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 piece of 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 a to be executed matches the function interception strategy of the task execution entry a, the function a to be executed can be taken 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 or after the execution logic of at least one selected target execution function. For example, if there is a target execution function:

[0102]

[0103] Furthermore, AOP technology can be used to define the pre-detection logic function and post-detection logic function for the target execution function:

[0104]

[0105] Furthermore, if the performance operation data to be monitored are the execution duration and the total execution memory consumption, the front 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] Further, 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, it is necessary to apply the AOP framework to the above functions 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 the present application, the detection logic function can be adjusted according to actual conditions, and the embodiments of the present application do not impose specific restrictions on this.

[0112] In some implementations, 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., so as to comprehensively and accurately monitor the usage of the target memory.

[0113] By injecting detection logic functions before and after the execution of the target execution function, cross-cutting concerns can be dynamically woven into the parts before and after the function to be executed without affecting the original code, so as to simplify the code structure and enhance maintainability and reusability. At the same time, in this way, the use of target memory can be monitored at the function level in a fine-grained manner, so as to comprehensively capture and analyze memory usage, timely discover performance bottlenecks and memory anomalies, and improve the stability and efficiency of the application.

[0114] In some implementations, in order to reduce false positives or focus on more important monitoring targets, the memory usage of a specific function to be executed may be ignored to reduce unnecessary monitoring data and improve the effectiveness of monitoring. For example, the memory abnormal 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] Wherein, the ignore annotation (such as @Monitor 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 without performing any additional monitoring operations 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 @Monitor 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, 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 the detection logic function before and 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 for processing sensitive data, functions with known operating 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 accurately control which methods need to be monitored and which methods can be ignored according to specific application scenarios and needs, so as to ensure that key business logic is fully monitored while avoiding unnecessary performance overhead on non-critical or known problem functions, improving the performance and efficiency of the system, simplifying monitoring configuration management, and making the code more concise and easy to maintain.

[0122] Step 105 , acquiring a plurality of performance operation data corresponding to when at least one target execution function is executed 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 function to be executed 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] The performance operation data may be a series of performance-related indicators collected during the execution of the target execution function. The performance operation data can reflect the memory usage of the system during the execution of the function, especially the memory usage. The performance operation data may include but is not limited to the execution time of the target execution function, the number of complete garbage collections during the execution cycle of the target execution function, the number of young generation garbage collections, and the total execution memory consumption, etc.

[0125] In some embodiments, a front logic detection function can be defined to record the starting state before the target execution function is executed, and then a post 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 is executed, the detection logic function based on AOP technology can obtain the current memory usage, thread status and other information through the Java Management Extensions interface as the benchmark data. After the target execution function is executed, 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 may be used to obtain thread information, including thread execution time, thread status, etc.; the GarbageCollectorMXBean interface may be used to obtain garbage collector information, including the number of young generation garbage collections, the number of complete garbage collections, etc.

[0128] By combining JMX and AOP technology, the performance operation data of key business methods can be accurately captured without invading the original business logic, such as execution time, number of complete garbage collections, number of young generation garbage collections, total execution memory consumption, etc.

[0129] In some implementations, the JVM management interface (JMX) can provide the necessary performance data source for the detection logic function 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 implementations, 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., so as to accurately measure the memory and performance of the target execution function and perform accurate abnormality detection. Exemplarily, step 105 may include:

[0131] (105.1) acquiring 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 at least one target execution function based on the execution start time and the execution end time;

[0132] (105.2) obtaining a first complete garbage collection number of the system at the beginning of execution of at least one target execution function, and a second complete garbage collection number of the system at the end of execution of at least one target execution function, and determining a complete garbage collection number within an execution cycle of at least one target execution function based on the first complete garbage collection number and the second complete garbage collection number;

[0133] (105.3) obtaining the number of first young generation garbage collections of the system at the beginning of execution of at least one target execution function, and the number of second young generation garbage collections of the system at the end of execution of at least one target execution function, and determining the number of young generation garbage collections within the execution cycle of at least one target execution function based on the number of first young generation garbage collections and the number of second young generation garbage collections;

[0134] (105.4) Obtain a first memory amount allocated to a target thread executing at least one target execution function at the beginning 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 to execute, 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. Exemplarily, 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 occurrence of Full GC events during the entire process of executing the target execution function, and is used to determine whether there are too many memory cleanup activities. Exemplarily, the number of full garbage collections may be calculated by 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 occur during the entire process of executing the target execution function, and the number of young generation garbage collections may be calculated by the difference between the second young generation garbage collection and the first young generation garbage collection. The number of young generation garbage collections may be used to characterize whether too many new objects are created or too many short-lifecycle objects are created during the process of running 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, which is used to determine whether there is a problem area causing a memory leak. The total execution memory consumption may be calculated by the difference between the second memory number and the first memory number.

[0147] Furthermore, full garbage collection can be the garbage collection of the old generation (Old Generation) in the JVM plus at least one other generation (such as the young generation). The triggering conditions of Full GC include insufficient space in the old generation, insufficient metaspace, too much garbage accumulated after the system has been running for a long time, etc. Full garbage collection has a greater impact on system performance because it will cause the application to pause (Stop-the-World pause), that is, during garbage collection, all application threads will be paused until the garbage collection is completed. The number of full garbage collections is closely related to the memory usage during the execution of the target execution function.

[0148] Young generation garbage collection mainly targets the Young Generation of the JVM, which is the storage area for newly created objects and usually occupies a small part of the heap memory. The purpose of young generation garbage collection is to recycle objects that are no longer referenced, and to move still surviving objects to the Survivor area or promote them to the old generation. Young generation garbage collection can also cause short application pauses, and the number of young generation garbage collections is closely related to the memory usage during the execution of the target execution function.

[0149] For example, if there is a target execution function processData, its execution time, number of complete garbage collections, number of young generation garbage collections, and total memory consumption during the execution cycle need to be detected.

[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 indicates 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 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 young generation garbage collections is 500 when the processData function starts executing, and the number of second young generation garbage collections is 520 when the processData function ends executing, then through the difference between the second young generation garbage collection times and the first young generation garbage collection times, 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, a first memory amount of 200MB is allocated to the target thread executing the function, and when the processData function ends executing, a 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 the above methods, the execution performance and resource consumption during the execution of the target execution function can be accurately measured, and multiple performance operation data can be generated. Through multiple performance operation data, in-depth insights into the operation efficiency and memory usage of the target execution function are provided, which helps to accurately and quickly identify performance bottlenecks, optimize memory management, and prevent memory leaks and other memory anomalies.

[0155] Step 106, obtaining the over-limit threshold corresponding to each performance operation data, and determining 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 a target memory is abnormal through multiple performance operation data, the multiple performance operation data obtained through 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 abnormal situation of the target memory.

[0157] The exceeding threshold may be a preset maximum allowable value of a performance operation data. When the actually monitored performance operation data exceeds the threshold, the system will consider that there is a potential performance problem or memory anomaly.

[0158] The memory abnormal 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 operation data with the corresponding over-limit threshold, it can be determined whether the performance operation data is normal. Taking the performance operation data as the total execution memory consumption as an example, the corresponding over-limit threshold is the memory consumption threshold. If the total execution memory consumption is 100MB and the memory consumption threshold is 200MB, since 100MB is less than 200MB, the target memory is not abnormal in terms of the total execution memory consumption.

[0161] In some implementations, the memory abnormality data detection result of the target memory can be obtained by comparing the magnitude relationship between multiple performance operation data and the corresponding over-limit threshold. For example, when any performance operation data is greater than the corresponding over-limit threshold, the memory abnormality data detection result is 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 pending functions contained in the currently loaded at least one target class object are determined, and each pending function is matched through a plurality of function interception strategies of a plurality of preset 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 pending 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 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 according to 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 the detection and the over-limit threshold, it can be ensured that the 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 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 collection thresholds, and the number of young generation garbage collection thresholds. In some embodiments, in order to improve the accuracy of anomaly detection, the use of the target memory 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 may 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 based on a size relationship between the execution time and the execution time threshold, and a second comparison result obtained based on a comparison between the average memory application rate and the average memory application 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 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;

[0168] (106.5) 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 is combined 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 request rate may be the average amount of memory allocated per unit time (such as milliseconds) during the execution of the target execution function. The average memory request rate may be calculated by 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 a 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. When both the first comparison result and the second comparison result are abnormal, the first detection sub-result is abnormal, otherwise it is "normal".

[0174] Among them, the second detection sub-result can be a result obtained based on the relationship between the total execution memory consumption of the target execution function and a 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 relationship between the number of complete garbage collections of the target execution function and a preset threshold number of complete garbage collections. When the number of complete garbage collections exceeds the threshold number of complete garbage collections, the third comparison result is "greater than"; otherwise it is "less than".

[0176] The third detection sub-result may be a further detection result obtained by combining the third comparison result and the second detection sub-result. When the third comparison result is that the number of complete garbage collections exceeds the threshold number of complete garbage collections, 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 the relationship between the number of young generation garbage collection times of the target execution function and a preset young generation garbage collection times threshold. If the number of young generation garbage collection times is greater than the young generation garbage collection times threshold, the fourth comparison result is "greater than", otherwise it 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 is 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 it 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 6MB / ms, 100ms<150ms means the first comparison result is that the execution time is normal. 5MB / ms<6MB / ms means the second comparison result is that the average memory request rate is normal. If both the first comparison result and the second comparison result are normal, the first detection sub-result is "normal".

[0183] Exemplarily, when calculating the second detection sub-result, if the memory consumption threshold is set to 450MB, and the total execution memory consumption 500MB>450MB exceeds the memory consumption threshold, then the second detection sub-result is "abnormal".

[0184] For example, when calculating the third detection sub-result, if the threshold of the number of complete garbage collections is set to 3 times, and 4 complete garbage collections occur during the execution of the processData function, 4 times>3 times, and the third comparison result indicates that the number of complete garbage collections exceeds the threshold. Since the number of complete garbage collections exceeds the threshold and the second detection sub-result is "abnormal", the third detection sub-result is "abnormal".

[0185] Exemplarily, 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 improving 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 in the ignore policy table based on the uniform resource locator to obtain a search result;

[0191] (B.2) When the search result indicates that a 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 when determining the memory anomaly data detection result of the target memory, the size relationship between the target performance operation data corresponding to the performance ignore item and the corresponding over-limit threshold is ignored.

[0192] Among them, the Uniform Resource Locator, or URL, is an address identifier pointing to a specific resource on the Internet and can be used to uniquely identify a Web service endpoint or API interface.

[0193] The search result may be a result obtained by matching and searching in a preset ignore strategy table based on the URL associated with the pending request. When 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 ignored items may be performance operation data that should not be included in the memory abnormal data detection range under certain circumstances. The performance operation data has been expanded above and will not be described in detail 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-stress 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, you can choose to ignore them 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, and users can send pending requests (such as HTTP requests) to obtain data. The backend code corresponding to the API endpoint has a key function processData(), which is responsible for processing pending requests and returning data. When a user sends a pending request to / data, the system can obtain the uniform resource locator (URL) of the pending request, that is, / data, and search the ignore policy table for performance ignore items related to / data based on the uniform resource locator.

[0197] Furthermore, if the search result finds 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 abnormality 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 abnormality, 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 avoid false alarms in memory anomaly data detection, reduce unnecessary performance optimization measures and alarms, thereby improving the accuracy and efficiency of the monitoring system, ensuring that actions are taken only when memory anomalies actually occur, and optimizing resource allocation and system response.

[0200] In some implementations, in order to optimize the memory usage efficiency of the 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 achieving function-level optimization to achieve the effect of application slimming. For example, the memory abnormality data detection method can also include:

[0201] (C.1) obtaining a memory change amplitude 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 amplitude 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;

[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 of times, 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 by the target thread of processData() is 300MB and the minimum amount of memory is 50MB. Therefore, the memory change range is calculated to be 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 number and the minimum memory number allocated by 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 limitations on this.

[0211] In some implementations, when modifying and optimizing the logic code of the target execution function to reduce the memory change range, the target execution function can be analyzed first. If the result of the analysis shows 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 unnecessary temporary object creation, such as by reusing objects or using object pools to reduce memory allocation. Alternatively, the memory occupancy can be reduced by reducing the number of loops or optimizing conditional judgments to reduce unnecessary memory usage, and so on.

[0212] Through the above methods, potential memory management problems or performance bottlenecks can be effectively identified, and 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 slimming and performance optimization of the application.

[0213] In some implementations, 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, and 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 high efficiency of the monitoring process, and achieve efficient and accurate analysis of anomalies. For example, the memory abnormal data detection method can also include:

[0214] (D.1) storing detection data when executing the target execution function within the function execution cycle in the information storage module of the target memory, and transmitting the detection data to the 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 multiple performance operation data; the early warning module is separated from the target thread that processes the target execution function;

[0215] (D.2) 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;

[0216] (D.3) Based on the playback data, the cause of the abnormality of the target memory is analyzed to obtain the result of the abnormality analysis.

[0217] The information storage module may be a data storage component for storing 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 the detection metadata generated by the task execution entry, the 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 playback data may be a series of detailed operation logs or status snapshots collected during the execution cycle of the target execution function, which can be used to reproduce the specific process of function execution.

[0220] Among them, the abnormal cause analysis result can be based on the playback data and other relevant detection data, and the result obtained after an in-depth analysis of the target memory usage through a specific algorithm or tool. The abnormal cause analysis result can include the specific abnormal cause, the possible impact range and the recommended solution.

[0221] Exemplarily, 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 calling parameters (detection metadata), memory allocation and release during execution (playback data), and performance operation 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 during the execution 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 of great significance, especially during high load or critical business periods. At the same time, storing playback data through the early warning module can help quickly locate the cause of memory anomalies and reduce 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, and the memory abnormal data detection device includes:

[0225] A response module 31 is used to respond to the memory abnormality data detection instruction and run 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;

[0226] A loading module 32, configured to respond to the request to be processed and load at least one target class object according to the request to be processed;

[0227] A matching module 33 is used to determine multiple functions to be executed contained in 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;

[0228] The injection module 34 is used to inject a detection logic function before or after the execution logic of at least one target execution function 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;

[0229] An acquisition module 35, configured to acquire, by detecting a logic function, a plurality of performance operation data corresponding to when at least one target execution function is executed, wherein each performance operation data is associated with a memory usage of a target memory when 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 implementation of the memory abnormal data detection method described above, and will not be repeated here. On 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 embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above memory abnormal data detection method when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0233] See also Figure 4 , Figure 4 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:

[0234] The processor 41 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (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 solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 42, and the processor 41 calls and executes the memory abnormal data detection method of the embodiment of this application;

[0236] Input / output interface 43, used to implement information input and output;

[0237] The communication interface 44 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);

[0238] A bus 45 that transmits information between the various components of the device (e.g., the processor 41, the memory 42, the input / output interface 43, and the 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 also 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 disposed 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 the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present 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 the present application are also applicable to similar technical problems.

[0243] Those skilled in the art will appreciate 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, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0245] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination 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 sequence. 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 of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising 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 the present 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 subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single 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 the present 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 schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0250] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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 to enable 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 (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as 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 the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights 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, a pre-injected memory abnormality detection data packet is run; wherein the memory abnormality detection data packet is used to detect the usage of the target memory; Responding to the pending request, and loading at least one target class object according to the pending request; 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; 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 means of 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; The over-limit threshold value 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 value.

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 within the execution cycle of the target execution function, the number of young generation garbage collections, and the total execution memory consumption. The multiple performance operation data corresponding to the execution of at least one target execution function are obtained by the detection logic function, including: 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 number of the system when the execution of the at least one target execution function starts, and a second complete garbage collection number of the system when the execution of the at least one target execution function ends, and determining a complete garbage collection number within an execution cycle of the at least one target execution function based on the first complete garbage collection number and the second complete garbage collection number; Obtaining a first young generation garbage collection number of the system when the execution of the at least one target execution function starts, and a second young generation garbage collection number of the system when the execution of the at least one target execution function ends, and determining a young generation garbage collection number within an execution cycle of the at least one target execution function based on the first young generation garbage collection number and the second young generation garbage collection number; 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 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 collection thresholds and the number of young generation garbage collection thresholds; The determining 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 value includes: Calculating the average memory request rate of the target execution function according to the ratio of the total execution memory consumption to the execution time; Obtaining a first detection sub-result based on a first comparison result obtained based on a size relationship between the execution time and the execution time threshold, and a second comparison result obtained based on a comparison between the average memory application rate and the average memory application rate threshold; Based on the magnitude relationship between the total execution memory consumption and the memory consumption threshold, obtaining a second detection sub-result; 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 is combined with the second detection sub-result to obtain a third detection sub-result; 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 is combined with the second detection sub-result to obtain a fourth detection sub-result; Based on the first detection sub-result, the second detection sub-result, the third detection sub-result, and the fourth detection sub-result, a memory abnormal data detection result of the target execution function is determined.

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, adding an ignore annotation to the first to-be-executed function; When the first function to be executed 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 function to be executed.

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 represents 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; 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: The detection data when the target execution function is executed within the function execution cycle is stored in the information storage module of the target memory, and after the target execution function is executed, the detection data is transmitted to the early warning module set relative to the target memory; wherein the detection data includes the detection metadata generated by the task execution entry for the target execution function, the playback data during the execution of the target execution function, and the multiple performance operation data; the early warning module is separated from the target thread processing 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 abnormal cause analysis is performed on the target memory to obtain an abnormal cause analysis result.

8. A memory abnormal data detection device, characterized in that: The device comprises: A response module, configured to respond to a memory abnormality data detection instruction and execute 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; A loading module, used to respond to the pending request and load at least one target class object according to the pending request; A matching module, used 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 through a plurality of function interception strategies of a plurality of preset task execution entrances to obtain a matching result; An injection module, configured to inject a detection logic function before or after the execution logic of 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; an acquisition module, configured to acquire, through the detection logic function, a plurality of performance operation data corresponding to when the at least one target execution function is executed, 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 abnormal data detection result of the target memory according to the size relationship between each performance operation data and the corresponding over-limit 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 memory abnormal data detection method 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

  • Memory detection method and device, equipment and storage medium

    CN117992204A

  • Peak detection method and apparatus, and computer device and storage medium

    WO2023193630A1