Performance analysis method

By configuring page input operations on the performance analysis system, combining local knowledge base and large language models to automatically analyze the performance of business machines, the problems of cumbersome operation and low analysis efficiency in the existing technology are solved, and efficient and accurate performance analysis is achieved.

CN120492299APending Publication Date: 2025-08-15BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510585882.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, business machine performance analysis requires logging into the machine deployment toolkit, which is cumbersome in operation, inefficient in analysis and inaccurate results.

Method used

By configuring page input operations on the performance analysis system, establishing performance analysis tasks, combining local knowledge bases and large language models to analyze sampling files, and automatically collect and analyze performance data of business machines.

Benefits of technology

It realizes one-click analysis without logging into the target device, improves the convenience and efficiency of performance analysis, generates multiple types of accurate performance analysis results, and expands the application scope and scalability of analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492299A_ABST
    Figure CN120492299A_ABST
Patent Text Reader

Abstract

The invention provides a performance analysis method, and relates to the technical field of computers, the performance analysis method comprises the following steps: responding to an input operation on a configuration page of a performance analysis system, and establishing a performance analysis task for target equipment; submitting a performance analysis task to the target device, so that the target device obtains a sampling file of the target device in response to the performance analysis task; and performing performance parameter analysis on the sampling file in combination with a local knowledge base and a large language model to obtain a performance analysis result of the target equipment. The accuracy and convenience of performance analysis can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a performance analysis method. Background Art

[0002] For any business machine, the performance of the business machine can be analyzed. In related technologies, it is generally necessary to log in to the corresponding business machine, deploy the corresponding sampling toolkit, manually execute data sampling commands, and have analysts manually analyze the sampled data to analyze the performance issues of the business machine.

[0003] In the above method, since it is necessary to log in to the corresponding business machine, the operation steps are cumbersome; and since the analysts have a unclear understanding of the sampled data, the analysis efficiency is low and the capability analysis results are inaccurate and incomplete. Summary of the Invention

[0004] The purpose of the present disclosure is to provide a performance analysis method, thereby overcoming, at least to a certain extent, the problems of low capability analysis efficiency and inaccurate capability analysis results caused by limitations and defects of related technologies.

[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.

[0006] According to one aspect of the present disclosure, a performance analysis method is provided, comprising:

[0007] In response to input operations on the configuration page of the performance analysis system, a performance analysis task for a target device is established;

[0008] Submitting a performance analysis task to the target device, so that the target device obtains a sample file of the target device in response to the performance analysis task;

[0009] The performance parameters of the sample file are analyzed in combination with the local knowledge base and the large language model to obtain a performance analysis result of the target device.

[0010] In an exemplary embodiment of the present disclosure, the acquiring the sample file of the target device in response to the performance analysis task includes:

[0011] The agent process on the target device initiates a sampling request in response to the performance analysis task, and determines the process identifier of the target device that needs to be sampled according to the sampling request;

[0012] Collecting a variety of sampled data of the business process corresponding to the process identifier, and aggregating the various sampled data into the sample file;

[0013] The sources of the various sampling data include one or more of the CPU, memory, lock, garbage collection, thread and JVM of the business process.

[0014] In an exemplary embodiment of the present disclosure, aggregating the plurality of sampling data into the sampling file includes:

[0015] The various sampling data are aggregated according to the performance analysis system name, the IP identifier of the target device, and the task identifier of the performance analysis task to obtain a sampling file corresponding to the type of the sampling data.

[0016] In an exemplary embodiment of the present disclosure, performing performance parameter analysis on the sample file in combination with the local knowledge base and the large language model to obtain the performance analysis result of the target device includes:

[0017] Determining hotspot data according to a sampling rate of the sampling file, and determining analysis data based on the hotspot data; the analysis data and the hotspot data are in the same stack;

[0018] Performing memory sampling analysis on the analysis data to obtain a memory analysis result, and performing lock sampling analysis on the analysis data to obtain a lock analysis result;

[0019] When no performance hotspot is determined based on the memory analysis result and the lock analysis result, code logic analysis is performed on the hotspot data in combination with the local knowledge base and the large language model to determine the CPU analysis result.

[0020] In an exemplary embodiment of the present disclosure, the analysis data includes memory analysis data or lock analysis data; and determining the analysis data based on the hotspot data includes:

[0021] Determine a processing method corresponding to the hotspot data, and determine a stack where the processing method is located;

[0022] Memory analysis data or lock analysis data is determined from a sampling file according to a method name of a processing method in the stack.

[0023] In an exemplary embodiment of the present disclosure, performing memory sampling analysis on the analysis data to obtain a memory analysis result, and performing lock sampling analysis on the analysis data to obtain a lock analysis result, includes:

[0024] If the memory sampling is high according to the analysis data, it is determined that there is a performance hotspot in the memory allocation and the stack with high memory allocation is located, and a first prompt mark is output as the memory analysis result;

[0025] If the lock sampling rate is high according to the analysis data, a performance hotspot of lock contention is determined, the stack where the lock contention occurs is located, and a second prompt mark is output as the lock analysis result.

[0026] In an exemplary embodiment of the present disclosure, the code logic analysis of the hotspot data is performed in combination with the local knowledge base and the large language model to determine the CPU analysis result, including:

[0027] Traversing the local knowledge base to determine whether the stack where the hotspot data is located matches the local knowledge base;

[0028] If the match is successful, the third prompt information is directly output;

[0029] If the match fails, the prompt word and the code of the stack where the hotspot data is located are input into the large language model, and the CPU analysis result is output;

[0030] The CPU analysis results include codes with performance hotspots and optimization solutions for the codes with performance hotspots.

[0031] In an exemplary embodiment of the present disclosure, the code includes a stack code and a context code; the step of inputting the prompt word and the stack code of the hotspot data into a large language model and outputting a CPU analysis result includes:

[0032] Parsing the prompt word to extract key information, converting the stack code into a first code vector, and converting the context code into a second code vector;

[0033] Understanding the grammatical structure of the stack code based on the first code vector, and determining functions and logic according to the first code vector and the second code vector;

[0034] Problems existing in the stack code are identified based on the grammatical structure, function and logic, the problematic stack code is decoded using a decoder, and an optimization solution for the stack code is generated based on the key information.

[0035] In an exemplary embodiment of the present disclosure, performing performance parameter analysis on the sample file in combination with the local knowledge base and the large language model to obtain the performance analysis result of the target device includes:

[0036] Determine hotspot data according to the sampling rate of the sampling file;

[0037] Determine memory analysis data or lock analysis data based on the hotspot data, and determine whether there is a memory allocation problem based on the memory analysis data; or determine whether there is a lock contention problem based on the lock analysis data;

[0038] When it is determined that the memory allocation problem or the lock contention problem exists, if it is determined based on the GC data that a GC problem exists, a local knowledge base match is performed based on the stack where the GC problem exists;

[0039] If the matching fails, the code of the stack with the GC problem is obtained, and the prompt word and the code are input into the large language model to generate a memory analysis result or a lock analysis result.

[0040] In an exemplary embodiment of the present disclosure, the performing of multiple performance parameter analyses on the target data in combination with the local knowledge base and the large language model to obtain the performance analysis results of the target device includes:

[0041] Obtain JVM operating parameters from the sampling file;

[0042] Matching the JVM operating parameters based on the local knowledge base, and determining the JVM operating parameters to be optimized when the match is successful;

[0043] If the match fails, the prompt word and the JVM operating parameters are input into the large language model, and the JVM operating parameters to be optimized and the optimization plan are output.

[0044] In the technical solutions provided in some embodiments of the present disclosure, on the one hand, there is no need for users to log in to the target device to perform tedious operations. The one-click analysis function can be implemented directly on the performance analysis system. Only the corresponding system name appkey for performing performance analysis and the IP identifier of the target device need to be filled in to complete data collection, which increases the convenience and efficiency of performance analysis and improves the usability of performance analysis. On the other hand, the performance analysis system can generate various types of performance analysis results by combining the local knowledge base and the large language model. Since the local knowledge base and the large language model are combined in the performance analysis process, efficient and accurate intelligent performance analysis can be achieved, which increases scalability and application scope, and increases comprehensiveness.

[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0047] Figure 1 A schematic diagram showing a system architecture to which the performance analysis method according to an embodiment of the present disclosure can be applied.

[0048] Figure 2 A schematic diagram of a performance analysis method according to an embodiment of the present disclosure is schematically shown.

[0049] Figure 3 A schematic diagram of establishing a performance analysis task in an embodiment of the present disclosure is schematically shown.

[0050] Figure 4 A schematic diagram of a system architecture for performing performance analysis in an embodiment of the present disclosure is shown schematically.

[0051] Figure 5 The following schematically illustrates the interaction between the performance analysis system and the target device according to an embodiment of the present disclosure.

[0052] Figure 6 A schematic diagram schematically illustrates a CPU hotspot analysis in an embodiment of the present disclosure.

[0053] Figure 7 A schematic diagram schematically illustrates memory hotspot analysis and lock hotspot analysis according to an embodiment of the present disclosure.

[0054] Figure 8 A schematic diagram schematically illustrates JVM parameter analysis according to an embodiment of the present disclosure.

[0055] Figure 9 A schematic diagram schematically illustrates a summary analysis of performance analysis results according to an embodiment of the present disclosure.

[0056] Figure 10 A schematic diagram schematically illustrates the performance analysis results in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0057] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0058] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0059] In order to solve the above technical problems, an embodiment of the present disclosure provides a performance analysis method that can be applied to scenarios where performance analysis is performed on any type of machine or device.

[0060] Figure 1 The following is a schematic diagram schematically showing a system architecture to which the performance analysis method according to an embodiment of the present disclosure can be applied.

[0061] In some embodiments, the system architecture 100 underlying performance analysis may include at least one server 110 and a target device 120. A performance analysis system may be configured on the server. An agent may be deployed on the target device 120. The server 110 and the target device 120 may be connected via a network 130.

[0062] exist Figure 1 Based on the system architecture shown, in response to input operations on the configuration page of the performance analysis system, a performance analysis task for the target device is established; the performance analysis task is submitted to the target device so that the target device obtains the sampling file; the performance parameters of the sampling file are analyzed in combination with the local knowledge base and the large language model to obtain the performance analysis results of the target device.

[0063] It should be noted that, in the above performance analysis method, the server 110 can be any type of server, and the client 120 can be any type of device, for example, any type of business device.

[0064] Next, refer to Figure 2 As shown, each step in the performance analysis method in the embodiment of the present disclosure is described in detail.

[0065] In step S210 , in response to an input operation on a configuration page of the performance analysis system, a performance analysis task for a target device is established.

[0066] In some embodiments of the present disclosure, the server is used as the execution entity for description. The server can be a device used to perform performance analysis processing on business machines. A performance analysis system can be deployed or installed on the server. The performance analysis system can be a functional module deployed in a management system deployed on a client or server. The management system can be a standalone application, a public account, a mini-program, or a separate webpage, without specific limitation here. The performance analysis system can be a module embedded in the management system.

[0067] refer to Figure 3 As shown in , the performance analysis system can be a functional module of the management system. All functional modules of the management system can be displayed on the operation interface of the server. If a trigger operation on the performance analysis system is detected, multiple historical performance analysis results can be displayed on the operation interface. In addition, new analysis controls and query controls can also be displayed on the operation interface. If a click operation on a new analysis control is detected, a configuration page can be displayed on the operation interface, and the configuration page is used to create a new performance analysis task for the target device. The configuration page includes an appkey area and a business machine area. Among them, the appkey area is used to enter the appkey, which refers to the system name used to perform performance analysis, such as the performance analysis system name; the business machine area is used to enter the target device identifier, which refers to the IP identifier of the business machine that needs to perform performance analysis.

[0068] When input operations are detected in the appkey area and business machine area on the configuration page, a new performance analysis task for the target device can be created.

[0069] In step S220 , the performance analysis task is submitted to the target device, so that the target device obtains the sample file of the target device in response to the performance analysis task.

[0070] In the disclosed embodiment, after the server creates a new performance analysis task for a target service device, the server and the target device communicate and interact via RPC. Therefore, the performance analysis task can be submitted to the target device via RPC, so that the target device collects the target device's sample files based on the submitted performance analysis task.

[0071] For example, upon receiving a performance analysis task, the target device may trigger a collection task to collect sample files from the target device according to the collection task. In some embodiments, data from the target device's business processes may be collected. The business process data may include various sampled data, specifically including various sampled data consisting of the business process's CPU, memory, threads, locks, and garbage collection.

[0072] In some embodiments, when a target device receives a performance analysis task, an agent process on the target device may initiate a sampling request in response to the performance analysis task, thereby triggering the collection task. The target device may determine the process identifier (PID) of the process to be sampled on the target device. For example, the "jps" command may be executed on the target device to locate Java programs. If there are too many programs, the first process will be used as the process PID (Process Identifier) to be sampled by default.

[0073] After determining the process PID to be sampled, multiple sampling data of the business process corresponding to the process ID of the target device is collected in parallel and aggregated into a sampling file. The sources of the multiple sampling data may include one or more of the business process's CPU, memory, locks, GC (garbage collection), threads, and JVM. Based on this, the multiple sampling data may include one or more of the business process's CPU, memory allocation, thread allocation, lock overhead, GC (garbage collection), JVM system parameters, and the JVM runtime environment.

[0074] Different sampling tools are used for different data types. For example, CPU, memory, and locks are all sampled using the async-profiler tool. The async-profiler tool is integrated into the target device's business system along with the target device's agent. GC information is directly obtained by reading the GC log of the business process. For JVM parameters, use the "ps -ef | grep java" command to output all JVM information.

[0075] After obtaining multiple sampling data, the multiple sampling data can be summarized into a sampling file. After the collection is completed, the multiple sampling data are packaged and summarized. Each sampling data corresponds to a standard naming rule. The naming rule can be determined based on the performance analysis system name, the IP identifier of the target device, and the task identifier of the performance analysis task. For example, the first position in the naming rule can be the performance analysis system name, that is, the appkey of the business, the second position is the IP identifier of the target device, and the third position is the task ID of this performance analysis task. The CPU sampling file is: / <appkey> / <ip> / <taskid> / cpu_tree_reverse.html. The memory sampling file can be named: / <appkey> / <ip> / <taskid> / cpu_tree_reverse.html.

[0076] After obtaining the sample files, you can package them and upload them to the storage address notified by the server. After the upload is complete, you can notify the server to proceed with the next performance analysis task. The server can then retrieve the sample files from the storage address and perform performance analysis on them to obtain multiple performance analysis results.

[0077] Figure 4 The system architecture diagram for performing performance analysis is shown schematically in Figure 4 As shown in , it mainly includes a performance analysis system on the server side and an agent deployed on the target device. In the embodiment of the present disclosure, the server side and the target device can communicate via RPC (Remote Procedure Call). When the server side calls the target device, it needs to specify the IP address of the target device.

[0078] Among them, the main functions of the server include at least: collecting user requests, forwarding requests and calling the agent deployed on the target device; analyzing the uploaded sample files and displaying them to the user; relying on the local knowledge base and the large prediction model as an extended knowledge base during analysis.

[0079] The target device's primary functions include: receiving collection tasks, collecting sampled data for one or more of the business process's CPU, memory, locks, garbage collection (GC), threads, and JVM. The device then aggregates and uploads the sampled data to cloud storage for server analysis. The device then notifies the server that sampling is complete and can proceed to the next performance analysis task.

[0080] Based on this, you can submit a performance analysis task on the configuration page of the performance analysis system and send the performance analysis task to the container where the business is located through GRPC communication. The container where the business is located can be the machine where the appkey is located, that is, the target device to be analyzed.

[0081] The agent deployed on the target device can initiate data collection tasks, sampling data from one or more of the business process's CPU, memory, locks, GC (garbage collection), threads, and JVM to obtain a variety of sampled data. Next, the agent deployed on the target device can organize the data into sample files. The sample files are uploaded to the cloud storage end, and the server is notified of the end of sampling via GRPC communication. This allows the server's performance analysis system to retrieve the sample files from the cloud storage end and submit analysis tasks for the sample files based on the local knowledge base and the large language model.

[0082] Figure 5 The interactive process diagram is shown schematically in Figure 5 As shown in , the entire interaction process mainly involves three parts: the performance analysis system, the target device (i.e., the business system), and the cloud storage end. It mainly includes the following steps:

[0083] Step S502: The user submits a performance analysis task to the business system.

[0084] In step S504, the business system receives a sampling request, which includes a task ID and a storage location.

[0085] Step S506: Find the process ID that needs to be sampled on the target device.

[0086] Step S508 : sampling data from one or more of the CPU, memory, lock, garbage collection, thread, and JVM in a parallel sampling manner, so that all sampled data can be aligned in time.

[0087] Step S510: Summarize the sampled data to obtain a sample file.

[0088] Step S512: Upload the sample file to the cloud storage terminal.

[0089] Step S514: The cloud storage terminal stores the sample file.

[0090] Step S516: Notify the performance analysis system that sampling is complete.

[0091] Step S518: Receive a sampling completion notification, the transmission content including the task ID.

[0092] Step S520: Obtain a sampling file.

[0093] Step S522: parse the sample file.

[0094] Step S524: The analysis is completed and the performance analysis results are displayed to the user.

[0095] In the disclosed embodiment, by establishing a performance analysis task on the performance analysis system, there is no need for users to log in to the target device to perform tedious operations. The one-click analysis function can be implemented directly on the performance analysis system. Only the corresponding system name appkey for performing performance analysis and the IP identifier of the target device need to be filled in to complete data collection, which increases the convenience and efficiency of performance analysis and improves the usability of performance analysis.

[0096] Next, in step S230, the performance parameter analysis of the sample file is performed in combination with the local knowledge base and the large language model to obtain the performance analysis result of the target device.

[0097] In the embodiment of the present disclosure, the local knowledge base may be a locally set knowledge base with hot issues. The performance parameter analysis may include one or more of CPU hot spot analysis, memory hot spot analysis, lock hot spot analysis, and JVM parameter analysis.

[0098] First, the specific process of CPU hotspot analysis based on performance parameter analysis is described. In some embodiments, CPU hotspot analysis mainly includes the following steps: determining hotspot data based on the sampling rate of the sampled file, and determining analysis data based on the hotspot data; performing memory sampling analysis on the analysis data to obtain memory analysis results, and performing lock analysis on the analysis data to obtain lock analysis results; if no performance hotspot is determined based on the memory analysis results and the lock analysis results, code logic analysis is performed on the hotspot data in combination with the local knowledge base and the large language model to determine the CPU analysis results.

[0099] The sampled data can be sorted according to the sampling rate of each type of sampled data in the sample file, and the top N bits of data can be identified as hotspot data in descending order of sampling rate. N can be, for example, 20, or other suitable values. Furthermore, after identifying the hotspot data, the CPU analysis results can be determined by combining memory sampling analysis, lock sampling analysis, and local knowledge base analysis.

[0100] Exemplarily, memory sampling analysis and lock sampling analysis can first be performed based on the hotspot data. Specifically, analysis data can be determined based on the hotspot data, memory sampling analysis can be performed on the analysis data to obtain memory analysis results, and lock sampling analysis can be performed on the analysis data to obtain lock analysis results. The analysis data may include memory analysis data and lock analysis data. When performing memory sampling analysis, the processing method corresponding to the hotspot data can be determined, such as method A, and the stack where the processing method is located can be determined; based on the method name of the processing method in the stack, the memory analysis data can be determined from the sampling data. The memory analysis data can be data in the same stack as the processing method corresponding to the hotspot data.

[0101] Furthermore, if the memory analysis data determines that the memory sampling is high, the memory analysis result is determined to indicate a performance hotspot in the memory allocation at that location. When determining high memory sampling based on the memory analysis data, a comprehensive judgment is required, taking into account memory usage patterns, sampling frequency, and resource consumption. Based on this, a stack with high memory usage can be identified, i.e., a stack with high memory usage, and a first prompt indicator can be generated as the memory analysis result. The first prompt indicator may include whether a performance hotspot was found and the cause. For example, the first prompt indicator may be "Performance hotspot found, caused by frequent memory allocation."

[0102] When performing lock sampling analysis, you can determine the processing method corresponding to the hotspot data, such as method B, and the stack in which the processing method resides. Based on the method name in the stack, you can determine the lock analysis data from the sampled data. The lock analysis data can also be data from the same stack as the processing method corresponding to the hotspot data.

[0103] Furthermore, if the lock analysis data indicates high lock sampling, the lock analysis result indicates a lock contention issue. Based on this, the stack with lock contention can be located, and a second prompt can be generated as the lock analysis result. The second prompt can include whether a performance hotspot has been found and the cause. For example, the second prompt could be "Performance hotspot found, caused by severe lock contention." In determining high lock sampling based on the lock analysis data, the sampling frequency, lock contention data, and resource consumption can be analyzed to determine whether a high lock sampling issue exists.

[0104] If the memory and lock analysis results don't identify a performance hotspot, further code logic analysis can be performed on the hotspot data using a local knowledge base and a large language model to confirm the CPU analysis results. If the memory analysis data indicates low memory sampling and the lock analysis data indicate low lock sampling, it can be assumed that no performance hotspot has been identified, and a problem with the code logic can be considered. A local knowledge base is a preconfigured knowledge base that stores data or rules indicating performance hotspots.

[0105] Exemplarily, the local knowledge base can be traversed to determine whether the stack where the hotspot data is located matches the local knowledge base, that is, to determine whether the stack has a hit rule based on the local knowledge base. Determining whether the stack has a hit rule means that when analyzing the stack, the rules of the local knowledge base can be matched with the rules in the stack to determine whether there is a hit rule. When the match is successful, it can be considered that there is a hit rule, and the third prompt identifier is directly output at this time. The third prompt identifier may include whether a performance hotspot is found and the corresponding optimization solution. For example, the third prompt identifier can be "performance hotspots are found, and the corresponding optimization solution is pushed to the user."

[0106] When the match fails, it can be considered that there is no hit rule. At this time, the hot spot data can be combined with the large language model to perform CPU hot spot analysis. In some embodiments, the prompt word and the code of the stack where the hot spot data is located can be input into the large language model to output the CPU analysis result; the CPU analysis result includes the code with performance hot spots and the optimization plan for the code with performance hot spots. The code of the stack where the hot spot data is located includes stack code and context code. The stack code refers to the code corresponding to the stack itself. The context code can be the first N lines of code and the last N lines of code adjacent to the stack code. The prompt word can be a prompt word related to the performance analysis task. When the performance analysis task is CPU hot spot analysis, the prompt word can be related to CPU hot spot analysis. For example, the prompt word can be "There is a performance problem in the following code. Please find the code that may have a hot spot and provide a reasonable solution." After the prompt word and the code of the stack where the hot spot data is located are input into the large language model, the prompt word can be parsed to extract key information; the stack code and the context code are converted into code vectors, specifically the stack code is converted into a first code vector, and the context code is converted into a second code vector. Based on the first code vector, the grammatical structure of the stack code is understood, and the function and logic of the code are determined based on the first code vector and the second code vector of the context code; problems in the stack code are identified based on the grammatical structure, function and logic, and the problematic stack code is decoded based on the decoder, and an optimization solution for the stack code is generated based on the key information.

[0107] Figure 6 The flowchart for CPU hot spot analysis is shown schematically in Figure 6 As shown in , it mainly includes the following steps:

[0108] Sort the sampled files by sampling rate and extract the top 20 percentages as hotspot data. Combined with memory sampling analysis, search for memory analysis data based on the methods in the stack. If the memory sampling rate is consistently high, this indicates a memory allocation hotspot. When a stack with high memory usage is found, the user is prompted with "Performance hotspot detected, caused by frequent memory allocation." Combined with lock sampling analysis, search for lock analysis data based on the methods in the stack. If the lock sampling rate is consistently high, this indicates lock contention. When a stack with lock contention is found, the user is prompted with "Performance hotspot detected, caused by severe lock contention."

[0109] If both memory and lock sampling rates are low, analysis based on the local knowledge base can indicate a problem with the code logic. The stack containing the hotspot data can be found and matched against the local knowledge base. The local knowledge base is looped through to determine if there are any matching rules for this stack. If there are matching rules, the user is prompted with "Performance hotspots discovered, and corresponding optimization solutions are provided." If there are no matching rules, the corresponding stack code and context are captured. The code and prompt words are fed into the large language model, and the model outputs the optimization solutions and returns them to the user.

[0110] Next, the specific process of analyzing performance parameters for memory hotspot analysis and lock hotspot analysis is described. In some embodiments, performing memory hotspot analysis mainly includes the following steps: determining hotspot data based on the sampling rate of the sampled file; determining memory analysis data based on the hotspot data, and determining whether there is a memory allocation problem based on the memory analysis data; if it is determined that there is a memory allocation problem, if the GC data determines that there is a GC problem, performing a local knowledge base match based on the stack with the GC problem; if the match fails, obtaining the code of the stack with the GC problem, and inputting the prompt word and code into the large language model to generate the memory analysis results.

[0111] For example, refer to Figure 7 As shown in , the data with the top N sampling rates, ranked from highest to lowest, can be identified as hotspot data. Furthermore, the processing method corresponding to the hotspot data, such as method A, can be determined, and the stack in which the processing method resides can be determined. Based on the method name of the processing method in the stack, memory analysis data can be determined from the sampled data. The memory analysis data can be data from the same stack as the processing method corresponding to the hotspot data. After determining the memory analysis data, it can be used to determine whether a memory allocation problem exists. If a memory allocation problem exists, GC data can be further obtained to determine whether a GC problem exists based on the GC data. If a GC problem exists, a local knowledge base match can be performed against the stack with the GC problem to determine whether there is a matching rule in the stack. If there is a matching rule in the stack, i.e., a match is successful, a prompt indicator can be output. The prompt indicator can include whether a performance hotspot was found and an optimization solution. If there is no matching rule in the stack, i.e., a match fails, the stack code and context code corresponding to the stack with the GC problem can be obtained. A prompt word, along with the stack code and context code, can be input into the large language model to generate memory analysis results. The prompt word can be related to memory hotspot analysis. For example, a prompt might be "The following code contains a memory allocation issue. Please find the code that may contain a hotspot and provide a reasonable solution." The memory analysis results can include the code with the memory allocation issue and the optimization solution for that code.

[0112] It should be noted that the process of lock hotspot analysis is the same as that of memory hotspot analysis, so it will not be repeated here.

[0113] Next, we will explain the specific process of JVM parameter analysis, which is a performance parameter analysis. The specific process of JVM parameter optimization may include the following steps: obtaining JVM operating parameters from a sample file; matching based on a local knowledge base, and determining the JVM operating parameters to be optimized if a match is successful; if a match fails, inputting the prompt word and JVM operating parameters into the large language model, which then outputs the JVM operating parameters to be optimized and an optimization solution. JVM operating parameters are a set of parameters that can be set when starting the Java Virtual Machine (JVM) to adjust the behavior and performance of the JVM.

[0114] JVM operating parameters can be environment parameters when the JVM is running, such as startup commands, JVM configuration, etc. Figure 8 As shown in , the local knowledge base can first be looped through to find rules that can optimize JVM parameters to determine the JVM operating parameters to be optimized in the JVM operating parameters. If the JVM operating parameters to be optimized are found based on the local knowledge base, a prompt identifier can be output. The prompt identifier can include the content of the JVM operating parameters to be optimized. If the JVM operating parameters to be optimized are not found based on the local knowledge base, the JVM operating parameters and the prompt word can be directly input into the large language model to obtain the JVM operating parameters to be optimized and an optimization solution for the JVM operating parameters to be optimized. The prompt word can be associated with the JVM parameter analysis. Since the JVM parameter configuration used in different environments may be different, the prompt word can include one or more of the operating environment, the operating operating system version, the kernel version, and the machine hardware configuration. For example, the prompt word can be "There is a program with an operating environment of 16C16G, running on the CentOS 7 operating system with a kernel version of 5.10. The following are its JVM parameters. Are there any parameter configurations that can be optimized?"

[0115] In the disclosed embodiment, by combining a local knowledge base and a large language model, CPU hotspot analysis, memory hotspot analysis, lock hotspot analysis, and JVM parameter analysis are performed on the target device, thereby improving the efficiency of performance analysis on the target device.

[0116] After obtaining the performance analysis results of the target device, the performance analysis results of each category can be summarized. Exemplarily, the performance analysis results of each category include the output of the local knowledge base and the output of the large language model. Based on this, the local knowledge base output and the large language model output in the performance analysis results of each category can be deduplicated, summarized, and formatted to be sent to the configuration page and displayed in the display area of the performance analysis results. However, the performance analysis results of different categories can be displayed separately, which is not specifically limited here.

[0117] Furthermore, the performance analysis results output by the large language model can be automatically added to the local knowledge base, thereby updating the local knowledge base. This updated local knowledge base and the large language model can then be used to analyze the performance parameters of the target device's sample files across multiple dimensions to obtain the target device's performance analysis results. By updating the local knowledge base based on the output of the large language model, knowledge base updates enhance analytical capabilities and increase scalability.

[0118] refer to Figure 9 As shown in , the output of the local knowledge base and the large language model corresponding to CPU hotspot analysis, the output of the local knowledge base and the large language model corresponding to memory hotspot analysis and lock hotspot analysis, and the output of the local knowledge base and the large language model corresponding to JVM parameter analysis can be summarized to combine and display the performance analysis results of the same category and display the performance analysis results of different categories separately. The display page of the performance analysis results can be as follows Figure 10 As shown in . Figure 10 As shown in , the optimization plan can be displayed partially or completely, and a view details control can be displayed around the optimization plan. If a click operation on the view details control is detected, the optimization plan details page can be displayed.

[0119] The technical solution in the disclosed embodiments eliminates the need for users to log in to the target device and perform tedious operations. Instead, one-click analysis can be performed directly on the performance analysis system. Data collection is completed by simply entering the corresponding system name, appkey, and the target device's IP address. This increases the convenience and efficiency of performance analysis, improving its usability. Furthermore, the performance analysis system can generate various types of performance analysis results by combining a local knowledge base with a large language model. By integrating the large language model into the performance analysis process, efficient, accurate, and intelligent performance analysis can be achieved, increasing scalability and application scope.

[0120] In an embodiment of the present disclosure, a performance analysis device is further provided. The performance analysis device includes the following modules: a task establishment module, a data acquisition module, and a performance analysis processing module, wherein:

[0121] A task establishment module is used to respond to input operations on the configuration page of the performance analysis system and establish a performance analysis task for the target device;

[0122] a data acquisition module, configured to submit a performance analysis task to the target device, so that the target device obtains a sample file of the target device in response to the performance analysis task;

[0123] The performance analysis processing module is used to perform performance parameter analysis on the sample file in combination with the local knowledge base and the large language model to obtain a performance analysis result of the target device.

[0124] In an exemplary embodiment of the present disclosure, the data collection module includes: a process determination module, which is used for the agent process on the target device to initiate a sampling request in response to the performance analysis task, and determine the process identifier that needs to be sampled on the target device according to the sampling request; a data aggregation module, which is used to collect multiple sampling data of the business process corresponding to the process identifier, and aggregate the multiple sampling data into the sampling file; wherein the sources of the multiple sampling data include one or more of the CPU, memory, lock, garbage collection, thread and JVM of the business process.

[0125] In an exemplary embodiment of the present disclosure, the data aggregation module includes: a sampling file sorting module, which is used to aggregate multiple sampling data according to the performance analysis system name, the IP identifier of the target device, and the task identifier of the performance analysis task to obtain a sampling file corresponding to the type of the sampling data.

[0126] In an exemplary embodiment of the present disclosure, the performance analysis processing module includes: an analysis data determination module, which is used to determine hot spot data according to the sampling rate of the sampling file, and determine analysis data based on the hot spot data; the analysis data and the hot spot data are in the same stack; a memory analysis and lock analysis module, which is used to perform memory sampling analysis on the analysis data to obtain memory analysis results, and perform lock sampling analysis on the analysis data to obtain lock analysis results; a code logic analysis module, which is used to perform code logic analysis on the hot spot data in combination with a local knowledge base and a large language model to determine a CPU analysis result when no performance hot spot is determined according to the memory analysis results and the lock analysis results.

[0127] In an exemplary embodiment of the present disclosure, the analysis data determination module includes: a stack determination module, which is used to determine the processing method corresponding to the hot spot data and determine the stack where the processing method is located; and a data determination module, which is used to determine memory analysis data or lock analysis data from a sampling file according to the method name of the processing method in the stack.

[0128] In an exemplary embodiment of the present disclosure, the memory analysis and lock analysis modules include: a memory analysis module, which is used to determine that the memory sampling is high according to the analysis data, determine that there is a performance hotspot in the memory allocation and locate the stack with high memory allocation, and output a first prompt identifier as the memory analysis result; a lock analysis module, which is used to determine that the lock sampling is high according to the analysis data, determine that there is a performance hotspot in the lock contention and locate the stack with lock contention, and output a second prompt identifier as the lock analysis result.

[0129] In an exemplary embodiment of the present disclosure, the code logic analysis module includes: a matching module, which is used to traverse the local knowledge base and determine whether the stack where the hotspot data is located matches the local knowledge base; a first matching module, which is used to directly output a third prompt information if the match is successful; a large model analysis module, which is used to input the prompt word and the code of the stack where the hotspot data is located into the large language model if the match fails, and output a CPU analysis result; wherein, the CPU analysis result includes the code with performance hotspots and the optimization plan for the code with performance hotspots.

[0130] In an exemplary embodiment of the present disclosure, the code includes stack code and context code; the large model analysis module includes: a code conversion module, which is used to parse the prompt word to extract key information, and convert the stack code into a first code vector, and convert the context code into a second code vector; a vector analysis module, which is used to understand the grammatical structure of the stack code based on the first code vector, and determine the function and logic according to the first code vector and the second code vector; a decoding module, which is used to identify problems in the stack code based on the grammatical structure, function and logic, and decode the problematic stack code based on a decoder, and generate an optimization solution for the stack code based on the key information.

[0131] In an exemplary embodiment of the present disclosure, the performance analysis processing module includes: a hotspot data determination module, which is used to determine the hotspot data according to the sampling rate of the sampling file; a problem judgment module, which is used to determine the memory analysis data or the lock analysis data based on the hotspot data, and judge whether there is a memory allocation problem according to the memory analysis data; or, judge whether there is a lock contention problem according to the lock analysis data; a knowledge base matching module, which is used to perform local knowledge base matching based on the stack with the GC problem if it is determined that there is a GC problem according to the GC data when it is determined that there is the memory allocation problem or the lock contention problem; and a code analysis module, which is used to obtain the code of the stack with the GC problem if the matching fails, and input the prompt word and the code into the large language model to generate a memory analysis result or a lock analysis result.

[0132] In an exemplary embodiment of the present disclosure, the performance analysis processing module includes: a JVM operating parameter determination module, which is used to obtain JVM operating parameters from the sampling file; a knowledge base matching module, which is used to match the JVM operating parameters based on the local knowledge base, and determine the JVM operating parameters to be optimized when the match is successful; and a large model processing module, which is used to input the prompt words and the JVM operating parameters into the large language model if the match fails, and output the JVM operating parameters to be optimized and the optimization plan.

[0133] It should be noted that the specific details of each part of the above-mentioned performance analysis device have been described in detail in some implementation methods of the performance analysis method. For undisclosed details, please refer to the implementation content of the method part, and thus will not be repeated here.

[0134] The exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program, and implements the above method when the computer program is executed by a processor.

[0135] In one embodiment, a computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The computer-readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk drive (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing the computer program, such as a read-only memory, NAND flash memory, and the like.

[0136] In one embodiment, the computer program product may be an intangible product containing a computer program. For example, the computer program product may be implemented as a virtual digital product, such as a digital file such as an executable file or installation package storing the computer program.

[0137] The code of the computer program can be written in one or more programming languages. Programming languages include C, Java, C++, etc. The program code can be executed entirely on the user computing device, partially on the user computing device, or as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device via any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., via an Internet connection provided by a carrier).

[0138] Computer programs can be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. Electronic devices can convert signals carrying computer programs into digital signals to run the computer programs. When the computer program is run on an electronic device, its code is used to cause the electronic device to execute (more specifically, to cause the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the method described above.

[0139] The exemplary embodiments of the present disclosure further provide an electronic device, such as the aforementioned terminal device or server. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as a computer program. The processor executes the executable instructions to perform the method steps of the various exemplary embodiments of the present disclosure. Furthermore, the electronic device may also include a display for displaying a graphical user interface.

[0140] Below, an electronic device is exemplified in the form of a general-purpose computing device. It should be understood that the electronic device here is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0141] An electronic device may include: a processor, a memory, a bus, an I / O (input / output) interface, a network adapter, and a display.

[0142] The memory may include volatile memory, such as RAM and cache memory, and non-volatile memory, such as ROM. The memory may also include one or more program modules, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, the program modules may include the modules in the aforementioned apparatus.

[0143] The processor may include one or more processing units, for example: the processor may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0144] The processor may be configured to execute the executable instructions stored in the memory, such as executing the above method.

[0145] The bus is used to connect different components of an electronic device and may include a data bus, an address bus, and a control bus.

[0146] An electronic device can communicate with one or more external devices (such as a keyboard, a mouse, an external controller, etc.) through an I / O interface.

[0147] An electronic device can communicate with one or more networks through a network adapter. For example, a network adapter can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. The network adapter can communicate with other modules of the electronic device through a bus.

[0148] The electronic device may display a graphical user interface via a display.

[0149] In addition, other hardware and / or software modules may be provided in the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0150] As can be seen from the above, the technical solutions of the present disclosure can be implemented as methods, devices, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, such as "circuits", "modules", or "systems".

[0151] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are merely exemplary, and the scope and spirit of the present disclosure are indicated by the claims, which should cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the field of the present technology that are not disclosed in the present disclosure.

[0152] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0153] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0154] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0155] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0156] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.< / taskid> < / ip> < / appkey> < / taskid> < / ip> < / appkey>

Claims

1. A performance analysis method, characterized in that: include: In response to input operations on the configuration page of the performance analysis system, a performance analysis task for a target device is established; Submitting a performance analysis task to the target device, so that the target device obtains a sample file of the target device in response to the performance analysis task; The performance parameters of the sample file are analyzed in combination with the local knowledge base and the large language model to obtain a performance analysis result of the target device.

2. The performance analysis method according to claim 1, wherein: The acquiring the sampling file of the target device in response to the performance analysis task includes: The agent process on the target device initiates a sampling request in response to the performance analysis task, and determines the process identifier of the target device that needs to be sampled according to the sampling request; Collecting a variety of sampled data of the business process corresponding to the process identifier, and aggregating the various sampled data into the sample file; The sources of the various sampling data include one or more of the CPU, memory, lock, garbage collection, thread and JVM of the business process.

3. The performance analysis method according to claim 2, characterized in that: The aggregating of the various sampling data into the sampling file includes: The various sampling data are aggregated according to the performance analysis system name, the IP identifier of the target device, and the task identifier of the performance analysis task to obtain a sampling file corresponding to the type of the sampling data.

4. The performance analysis method according to claim 1, wherein: The performing performance parameter analysis on the sample file in combination with the local knowledge base and the large language model to obtain the performance analysis result of the target device includes: Determining hotspot data according to a sampling rate of the sampling file, and determining analysis data based on the hotspot data; the analysis data and the hotspot data are in the same stack; Performing memory sampling analysis on the analysis data to obtain a memory analysis result, and performing lock sampling analysis on the analysis data to obtain a lock analysis result; When no performance hotspot is determined based on the memory analysis result and the lock analysis result, code logic analysis is performed on the hotspot data in combination with the local knowledge base and the large language model to determine the CPU analysis result.

5. The performance analysis method according to claim 4, characterized in that: The analysis data includes memory analysis data or lock analysis data; and determining the analysis data based on the hotspot data includes: Determining a processing method corresponding to the hotspot data and determining a stack where the processing method is located; Memory analysis data or lock analysis data is determined from a sampling file according to a method name of a processing method in the stack.

6. The performance analysis method according to claim 4, characterized in that: The performing memory sampling analysis on the analysis data to obtain a memory analysis result, and performing lock sampling analysis on the analysis data to obtain a lock analysis result, includes: If the memory sampling is high according to the analysis data, it is determined that there is a performance hotspot in the memory allocation and the stack with high memory allocation is located, and a first prompt mark is output as the memory analysis result; If the lock sampling rate is high according to the analysis data, a performance hotspot of lock contention is determined, the stack where the lock contention occurs is located, and a second prompt mark is output as the lock analysis result.

7. The performance analysis method according to claim 4, characterized in that: The code logic analysis of the hotspot data is performed in combination with the local knowledge base and the large language model to determine the CPU analysis result, including: Traversing the local knowledge base to determine whether the stack where the hotspot data is located matches the local knowledge base; If the match is successful, the third prompt information is directly output; If the match fails, the prompt word and the code of the stack where the hotspot data is located are input into the large language model, and the CPU analysis result is output; The CPU analysis results include codes with performance hotspots and optimization solutions for the codes with performance hotspots.

8. The performance analysis method according to claim 7, characterized in that: The code includes a stack code and a context code; The prompt word and the code of the stack where the hotspot data is located are input into the large language model, and the CPU analysis result is output, including: Parsing the prompt word to extract key information, converting the stack code into a first code vector, and converting the context code into a second code vector; Understanding the grammatical structure of the stack code based on the first code vector, and determining functions and logic according to the first code vector and the second code vector; Problems existing in the stack code are identified based on the grammatical structure, function and logic, the problematic stack code is decoded using a decoder, and an optimization solution for the stack code is generated based on the key information.

9. The performance analysis method according to claim 1, characterized in that: The performing performance parameter analysis on the sample file in combination with the local knowledge base and the large language model to obtain the performance analysis result of the target device includes: Determine hotspot data according to the sampling rate of the sampling file; Determine memory analysis data or lock analysis data based on the hotspot data, and determine whether there is a memory allocation problem based on the memory analysis data; or determine whether there is a lock contention problem based on the lock analysis data; When it is determined that the memory allocation problem or the lock contention problem exists, if it is determined based on the GC data that a GC problem exists, a local knowledge base match is performed based on the stack where the GC problem exists; If the matching fails, the code of the stack with the GC problem is obtained, and the prompt word and the code are input into the large language model to generate a memory analysis result or a lock analysis result.

10. The performance analysis method according to claim 1, characterized in that: The target data is analyzed for multiple performance parameters by combining the local knowledge base and the large language model to obtain a performance analysis result of the target device, including: Obtain JVM operating parameters from the sampling file; Matching the JVM operating parameters based on the local knowledge base, and determining the JVM operating parameters to be optimized when the match is successful; If the match fails, the prompt word and the JVM operating parameters are input into the large language model, and the JVM operating parameters to be optimized and the optimization plan are output.