Program execution process restoration method and device, equipment, medium and program product

By collecting and preprocessing the kernel event and stack information of the program, generating time-sequential data and visually displaying it, the limitations of program execution process restoration in the prior art are solved, and performance analysis of high precision, timing and link focus is achieved.

CN119645806APending Publication Date: 2025-03-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411717388.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art has limitations in restoring the program execution process, including the lack of accuracy of traditional triggered Profiling tools and the inability to recognize high-frequency calls or long-term occupations by the aggregated Continuous Profiling tools, and only support process-level data display.

Method used

The kernel event and program stack information of the program are collected through the data acquisition component, and the back-end proxy component is used to preprocess and generate time-sequential data, and store it in the target database. The front-end visual display component obtains timed data from the database and generates a back view of the program execution process.

Benefits of technology

It realizes automatic trigger program performance analysis, high-precision, timing, and link-focus performance analysis, can continuously observe the program execution process, reduce the difficulty of performance problem analysis, and accurately locate the fault site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645806A_ABST
    Figure CN119645806A_ABST
Patent Text Reader

Abstract

The invention discloses a program execution process restoration method and device, equipment, a medium and a program product. The method is cooperatively executed by a data acquisition component, a back-end agent component and a front-end visual display component in a program execution process restoration system, and comprises the following steps of: acquiring a kernel event and program stack information of a program through the data acquisition component; preprocessing the kernel event and the program stack information acquired by the data acquisition component through the back-end agent component to generate time-series data, and sending the time-series data to a target database in the program execution process restoration system for storage; and obtaining the time sequence data in the target database through a front-end visual display component, and generating a program execution process backtracking view according to the time sequence data for a user to view. According to the technical scheme, the method can be applied to the field of distributed technologies, program performance analysis can be automatically triggered, and the program execution process can be continuously observed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a method, device, equipment, medium and program product for restoring a program execution process. Background Art

[0002] Profiling is a dynamic analysis technology that is extremely critical in the process of program development and optimization. It mainly uses the event sampling principle to carry out its work. This principle takes performance events as the core basis, collects and analyzes various performance events during program execution, and then achieves an in-depth exploration of program behavior.

[0003] In the existing technology, traditional trigger-type profiling tools or aggregated continuous profiling tools are generally used for collection and analysis. However, the capture of fault points of traditional trigger-type profiling tools relies on manual triggering, which has poor accuracy. Aggregated continuous profiling tools lose data time series after aggregation statistics, and cannot identify whether the business is a high-frequency call or a long-term occupation. In addition, they only support process-level data display, and a single data point reflects the statistical value within a period of time. The existing technology has great limitations in restoring the program execution process. Summary of the invention

[0004] The present invention provides a method, device, equipment, medium and program product for restoring the program execution process, which can automatically trigger program performance analysis and continuously observe the program execution process.

[0005] According to one aspect of the present invention, a method for restoring a program execution process is provided, which is executed by a data acquisition component, a back-end proxy component, and a front-end visualization display component in a program execution process restoration system, and includes:

[0006] Collecting the kernel events and program stack information of the program through a data collection component; wherein the data collection component includes a Java process and a tracking software development kit;

[0007] Through the back-end proxy component, the kernel events and program stack information collected by the data collection component are preprocessed to generate time-series data, and the time-series data is sent to the target database in the program execution process restoration system for storage;

[0008] Through the front-end visual display component, the time-series data is obtained in the target database, and a program execution process backtracking view is generated according to the time-series data for the user to view.

[0009] Optionally, the data collection component can be used to collect kernel events of the program, including:

[0010] By tracing the software development kit, the eBPF technology is used to collect kernel events in a timely manner, and the kernel events are sent to a ring buffer so that the back-end agent component can obtain the kernel events in the ring buffer;

[0011] The tracking software development kit is deployed in an application container; the kernel events include system call events, CPU switching events, thread information, and link information.

[0012] The advantage of this setting is that the eBPF technology can dynamically and fine-grainedly observe and collect data on various events in the kernel without modifying the kernel source code. It can accurately capture key kernel events such as system call events, CPU switching events, thread information, and link information, and ensure that the collected kernel event data has a clear time sequence.

[0013] Optionally, the program stack information of the program is collected through the data collection component, including:

[0014] Through the Java process, the stack information and thread information of the program are collected respectively, and the stack information and the thread information are sent to the back-end proxy component; wherein the Java process is deployed in the application container.

[0015] The advantage of this setting is that by deploying the Java process in the application container, the application can be isolated from other applications or system environments, so that the collected stack information and thread information are more targeted and only reflect the running status of the program in the application container.

[0016] Optionally, use the eBPF technology to perform sequential collection of kernel events through the tracing SDK, including:

[0017] By tracing the software development kit, using the data collection probes deployed at the system call entry and system call exit respectively, the system call entry parameters and system call exit parameters are collected, and a system call event is generated; wherein the system call event includes the system call entry event and exit event.

[0018] The advantage of this setting is that by deploying data collection probes at the system call entry and exit, the key parameters in the system call process can be accurately captured. Based on the system call entry parameters and the system call exit parameters, a complete system call life cycle record can be constructed, which can help locate system performance bottlenecks.

[0019] Optionally, the backend proxy component pre-processes the kernel events and program stack information collected by the data collection component to generate time-series data, including:

[0020] Obtaining kernel events in the ring buffer through a poller in the backend proxy component, and obtaining program stack information through a controller in the backend proxy component;

[0021] Through the backend proxy component, according to the kernel event and program stack information, event data of the CPU switching point and event parameters of each event data;

[0022] Through the backend proxy component, the event data is parsed and the thread data and timestamp information of each event are extracted;

[0023] Through the back-end proxy component, kernel events and program stack information are classified, associated and identified according to the event data, event parameters, thread data and timestamp information of the CPU switching point, and timing information is generated.

[0024] The advantage of this setting is that by obtaining event data of the CPU switching point based on kernel events and program stack information, it is easy to understand the allocation and switching of CPU resources between different threads or processes, and to parse the event data and extract the thread data and timestamp information of each event, further deepening the data mining, which can reflect the multi-threaded architecture of the program and the status of each thread, execution order, etc., so that when analyzing the program execution process later, it is possible to clearly track the occurrence and development of events in a time context.

[0025] Optionally, the program execution process traceback view includes a thread performance view and a link advanced view;

[0026] Among them, the thread performance view includes a program execution process observation view, a kernel event visualization display, and an indicator data display view; the link advanced view includes a link span view and a link critical moment analysis view.

[0027] The benefits of this setting are: it can help users understand the resource utilization and event triggering during the interaction between the program and the kernel, analyze program performance and behavior from the kernel level, accurately locate performance hotspots or fault points in the link, and help users quickly grasp the core problem points in the program execution link and conduct targeted analysis and solutions.

[0028] According to another aspect of the present invention, a program execution process restoration device is provided, which is executed by a data acquisition component, a back-end proxy component, and a front-end visualization display component in a program execution process restoration system, and includes:

[0029] A data collection module, used to collect kernel events and program stack information of a program through a data collection component; wherein the data collection component includes a Java process and a tracking software development kit;

[0030] The data processing module is used to pre-process the kernel events and program stack information collected by the data collection component through the back-end proxy component, generate time-series data, and send the time-series data to the target database in the program execution process restoration system for storage;

[0031] The visualization display module is used to obtain time-series data in the target database through a front-end visualization display component, and generate a program execution process backtracking view based on the time-series data for user viewing.

[0032] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0033] at least one processor; and

[0034] a memory communicatively connected to the at least one processor; wherein,

[0035] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program execution process restoration method described in any embodiment of the present invention.

[0036] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the program execution process restoration method described in any embodiment of the present invention when executed.

[0037] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the program execution process restoration method described in any embodiment of the present invention is implemented.

[0038] The technical solution of the embodiment of the present invention utilizes a data collection component to collect kernel events and program stack information of a program, utilizes a back-end proxy component to pre-process the kernel events and program stack information collected by the data collection component, generates timed data, and sends the timed data to a target database in a program execution process restoration system for storage, utilizes a front-end visualization display component to obtain timed data in the target database, and generates a program execution process backtracking view based on the timed data, so that program performance analysis can be automatically triggered in a manner for user viewing, thereby achieving high-precision, timed, and link-focused performance analysis, and continuously observing the program execution process, effectively reducing the difficulty of analyzing production business performance problems, especially when facing performance-related difficult problems, accurately locating the fault site, reducing the difficulty of troubleshooting complex problems such as multi-threaded CPU contention, storage network I / O blocking, and lock contention, greatly reducing the location time of such occasional performance problems, and reducing the human resource consumption of expert consultation-style centralized offices.

[0039] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 is a flowchart of a method for restoring a program execution process provided according to Embodiment 1 of the present invention;

[0042] Figure 2 is a structural diagram of a program execution process restoration system provided according to an embodiment of the present invention;

[0043] Figure 3 is a flowchart of another method for restoring a program execution process provided according to Embodiment 2 of the present invention;

[0044] Figure 4 is a schematic diagram of the structure of a program execution process restoration device provided according to Embodiment 3 of the present invention;

[0045] Figure 5 It is a structural schematic diagram of an electronic device for implementing the program execution process restoration method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] Embodiment 1

[0049] Figure 1 This is a flowchart of a method for restoring a program execution process provided in the first embodiment of the present invention. This embodiment is applicable to the case where data of the program execution process is collected in time sequence and visualized. The method can be executed by a program execution process restoration device. The program execution process restoration device can be implemented in the form of hardware and / or software and can generally be configured in a computer or processor with data processing functions. Figure 1 As shown, the method includes:

[0050] S110 , collecting kernel events and program stack information of the program through a data collection component.

[0051] Among them, the data collection components include Java processes and tracking software development kits.

[0052] Figure 2 FIG. 1 is a schematic diagram of an optional program execution process restoration system. Figure 2 As shown, the data collection component can be configured in an application container in the host machine. Multiple application containers can be configured in the host machine, and the data collection component is configured in each application container.

[0053] Optionally, the software development kit may be a Trace SDK, which can be used to record and analyze various events and operations during the operation of the software system, including but not limited to function calls, system resource usage (such as CPU, memory), network requests, etc. In a distributed system, the Trace SDK can track request links across multiple services and multiple nodes. For example, in an e-commerce system with a microservice architecture, a user's request to purchase a product may pass through multiple microservices such as user service, product service, and order service. The Trace SDK can generate a unique identifier (Trace ID) for this request and track the processing of the request in each microservice, including the response time and call sequence of each microservice, so as to help developers locate problems in a distributed environment, such as a slow response of a microservice or a network communication failure.

[0054] Optionally, kernel events can refer to various activities or operations that occur in the kernel of the operating system. The kernel is the core part of the operating system and is responsible for managing various system resources, such as CPU, memory, device I / O, etc. When an application requests services from the operating system, such as file reading and writing, process creation or destruction, network communication, etc., these operations will trigger kernel events.

[0055] Optionally, the program stack information may refer to information contained in a data structure used to store function call related data during program execution. The stack is a data structure that follows the last-in-first-out principle. When a program is running, each time a function is called, a stack frame is created in the stack. The stack frame contains rich information, such as the local variables of the function, the return address of the function, the value of parameter passing, etc. This information is combined to form the program stack information.

[0056] Optionally, by analyzing the program stack information, you can understand the execution flow of the program, such as the calling order between functions, the parameter passing of each function, etc. When debugging a program or performing performance analysis, the program stack information can help developers locate where the program execution has problems, or analyze whether the calling frequency of a certain method is too high, which may lead to performance bottlenecks.

[0057] S120, preprocessing the kernel events and program stack information collected by the data collection component through the back-end proxy component, generating time-series data, and sending the time-series data to the target database in the program execution process restoration system for storage.

[0058] like Figure 2As shown, the backend proxy component can be deployed in the same host machine as the data collection component. The backend proxy component can include a kernel event collection module and a program stack collection module. The program stack collection module can directly obtain the program stack information sent by the Java process, and the kernel event collection module can collect kernel events in the kernel state. The kernel events in the kernel state are sent by the Trace SDK. The backend proxy component can associate the information collected by the data collection component and store the processed information in the target database.

[0059] Optionally, the target database can be a time-series database, such as the Elasticsearch database. The distributed nature of Elasticsearch enables it to process large-scale data and distribute data on multiple nodes (servers). These nodes together form a cluster, each of which can store data and process query requests, and the nodes can communicate and collaborate with each other. For example, when a query request arrives, the nodes in the cluster will work together to quickly find data that meets the conditions. This distributed architecture also provides high availability, and the entire cluster can still operate normally even if some nodes fail.

[0060] Optionally, the backend proxy component mainly implements the timing association and data aggregation between stack information and system resource consumption based on thread information and clock information, additionally provides link information association, and stores the processed CPU full time slice data into the timing database.

[0061] In an optional implementation, the event stream passed from the kernel program to the user space program can be read from the circular buffer between the kernel state and the user state, and the event stream can be preprocessed and filtered through effective CPU switching point information to prepare data for the final formation of the timeline. In addition, by extracting key information such as thread data and timestamps, kernel events and stack data can be classified, associated and identified, and finally output to the time series database.

[0062] Optionally, generating time-series data may refer to the backend agent component processing the collected kernel events and program stack information in chronological order to form time-stamped, ordered time-series data, so that the program execution process can be subsequently analyzed and restored according to the time context.

[0063] S130. Obtain time-series data in the target database through a front-end visualization display component, and generate a program execution process backtracking view based on the time-series data for user viewing.

[0064] Optionally, the front-end visualization display component may be a Dashboard component, which is usually used to display multiple key data indicators and related information on a page in the form of intuitive graphics, charts, tables, etc.

[0065] Optionally, the program execution process backtracking view may include a thread performance view and a link advanced view; the thread performance view includes a program execution process observation view and a kernel event visualization and indicator data display view; the link advanced view includes a link span view and a link critical moment analysis view.

[0066] Optionally, the program execution process observation view may refer to a view in the thread performance view that is used to display information such as the program execution flow, the execution order of each function or code module, and the time consumption. It presents the program execution steps in a graphical or list format, allowing the user to clearly see the program execution path and the time consumption of different parts, which helps to discover bottlenecks or abnormal processes in the execution process.

[0067] Optionally, the kernel event visualization and indicator data display view can refer to presenting kernel events in a visual manner in the thread performance view, such as using charts to display the frequency and time distribution of kernel events, and displaying indicator data related to kernel events, such as memory allocation, CPU usage, etc., to help users understand resource utilization and event triggering during the interaction between the program and the kernel, and analyze program performance and behavior from the kernel level.

[0068] Optionally, the link Span view can display information about each span in the program execution link. Span can be understood as an execution segment or stage in the link. This view presents the start and end time, execution duration, resource consumption involved, and relationship with other spans of each span. By analyzing the span, you can accurately locate the performance hotspots or fault points in the link.

[0069] Optionally, the link critical moment analysis view can focus on key time points or key events in the link execution process, such as the long wait caused by a function call, the moment when resource competition occurs, etc. By highlighting these key moments and their related information, such as the program status at the time, the threads and resources involved, etc., it helps users quickly grasp the core problem points in the program execution link and conduct targeted analysis and solutions.

[0070] The technical solution of the embodiment of the present invention utilizes a data collection component to collect kernel events and program stack information of a program, utilizes a back-end proxy component to pre-process the kernel events and program stack information collected by the data collection component, generates timed data, and sends the timed data to a target database in a program execution process restoration system for storage, utilizes a front-end visualization display component to obtain timed data in the target database, and generates a program execution process backtracking view based on the timed data, so that program performance analysis can be automatically triggered in a manner for user viewing, thereby achieving high-precision, timed, and link-focused performance analysis, and continuously observing the program execution process, effectively reducing the difficulty of analyzing production business performance problems, especially when facing performance-related difficult problems, accurately locating the fault site, reducing the difficulty of troubleshooting complex problems such as multi-threaded CPU contention, storage network I / O blocking, and lock contention, greatly reducing the location time of such occasional performance problems, and reducing the human resource consumption of expert consultation-style centralized offices.

[0071] Embodiment 2

[0072] Figure 3 This is a flowchart of a method for restoring a program execution process provided by Embodiment 2 of the present invention. Based on the above embodiments, this embodiment specifically describes the method for restoring a program execution process. Figure 3 As shown, the method includes:

[0073] S210, using the tracking software development kit, using the eBPF technology to collect kernel events in a timely manner, and sending the kernel events to a ring buffer, so that the back-end proxy component can obtain the kernel events in the ring buffer.

[0074] Among them, the tracking software development kit is deployed in the application container; kernel events include system call events, CPU switching events, thread information and link information.

[0075] Among them, by tracing the software development kit, the eBPF technology is used to collect kernel events in a timely manner, including:

[0076] By tracing the software development kit, using the data collection probes deployed at the system call entry and system call exit respectively, the system call entry parameters and system call exit parameters are collected, and a system call event is generated; wherein the system call event includes the system call entry event and exit event.

[0077] Optionally, eBPF (Extended Berkeley Packet Filter) is a kernel technology that allows custom programs to be safely run in the operating system kernel. Custom programs can be triggered when kernel events occur, such as the entry and exit of system calls. By writing eBPF programs, information related to system calls can be captured.

[0078] Optionally, a ring buffer is a data structure used to efficiently transfer data between user mode and kernel mode. The eBPF program puts the generated system call entry and exit events into the ring buffer, and then the user mode program can read these events from this buffer for subsequent analysis.

[0079] In a specific implementation, the tracing software development kit can be used to predefine static tracing points Syscall Tracepoint in the kernel to track system call related events. Syscall Tracepoint can be located at key locations such as the entry and exit of the system call. For example, the system call entry sys_enter and exit sys_exit can be traced. When a system call starts, the eBPF program can record related parameters, timestamps and other information to generate an entry event. Similarly, when the system call ends, the exit event information such as the return value and execution time is recorded.

[0080] S220, respectively collecting the stack information and thread information of the program through the Java process, and sending the stack information and thread information to the backend proxy component.

[0081] Among them, the Java process is deployed in the application container.

[0082] S230, obtaining kernel events in the ring buffer through the poller in the backend proxy component, and obtaining program stack information through the controller in the backend proxy component.

[0083] In an optional implementation, after the Trace SDK writes information to the kernel, the kernel may communicate with the backend agent component of the user space using a system call interface, thereby transmitting the kernel events of the program to the backend agent component.

[0084] Optionally, in user mode, that is, the backend proxy component, the call event can be read from the ring buffer through the poller, and then the event can be sorted according to the timestamp of the event, so as to construct the timing relationship of the kernel event of the CPU switching point. For example, if a sys_enter event of a process actively calling sched_yield is read first, then a hardware interrupt entry event is read, and then a sys_exit event of sched_yield is read, it can be analyzed that a hardware interrupt occurred during the process of the process actively giving up the CPU, and the impact of the interrupt on the CPU switching can be further analyzed.

[0085] S240, through the backend proxy component, according to the kernel event and program stack information, the event data of the CPU switching point and the event parameters of each event data.

[0086] S250: parse each event data through the backend proxy component, and extract thread data and timestamp information of each event.

[0087] S260. Classify, associate and identify kernel events and program stack information according to event data, event parameters, thread data and timestamp information of CPU switching points through a backend proxy component, and generate timing information.

[0088] S270, obtaining time-series data in the target database through a front-end visualization display component, and generating a program execution process backtracking view according to the time-series data for user viewing.

[0089] The technical solution of the embodiment of the present invention utilizes a data collection component to collect kernel events and program stack information of a program, utilizes a back-end proxy component to pre-process the kernel events and program stack information collected by the data collection component, generates timed data, and sends the timed data to a target database in a program execution process restoration system for storage, utilizes a front-end visualization display component to obtain timed data in the target database, and generates a program execution process backtracking view based on the timed data, so that program performance analysis can be automatically triggered in a manner for user viewing, thereby achieving high-precision, timed, and link-focused performance analysis, and continuously observing the program execution process, effectively reducing the difficulty of analyzing production business performance problems, especially when facing performance-related difficult problems, accurately locating the fault site, reducing the difficulty of troubleshooting complex problems such as multi-threaded CPU contention, storage network I / O blocking, and lock contention, greatly reducing the location time of such occasional performance problems, and reducing the human resource consumption of expert consultation-style centralized offices.

[0090] Embodiment 3

[0091] Figure 4 This is a schematic diagram of the structure of a program execution process restoration device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a data acquisition module 310, a data processing module 320 and a visualization display module 330.

[0092] The data collection module 310 is used to collect the kernel events and program stack information of the program through the data collection component; wherein the data collection component includes a Java process and a tracking software development kit.

[0093] The data processing module 320 is used to pre-process the kernel events and program stack information collected by the data collection component through the back-end proxy component, generate time-series data, and send the time-series data to the target database in the program execution process restoration system for storage.

[0094] The visualization display module 330 is used to obtain time-series data in the target database through a front-end visualization display component, and generate a program execution process backtracking view according to the time-series data for user viewing.

[0095] The technical solution of the embodiment of the present invention utilizes a data collection component to collect kernel events and program stack information of a program, utilizes a back-end proxy component to pre-process the kernel events and program stack information collected by the data collection component, generates timed data, and sends the timed data to a target database in a program execution process restoration system for storage, utilizes a front-end visualization display component to obtain timed data in the target database, and generates a program execution process backtracking view based on the timed data, so that program performance analysis can be automatically triggered in a manner for user viewing, thereby achieving high-precision, timed, and link-focused performance analysis, and continuously observing the program execution process, effectively reducing the difficulty of analyzing production business performance problems, especially when facing performance-related difficult problems, accurately locating the fault site, reducing the difficulty of troubleshooting complex problems such as multi-threaded CPU contention, storage network I / O blocking, and lock contention, greatly reducing the location time of such occasional performance problems, and reducing the human resource consumption of expert consultation-style centralized offices.

[0096] Based on the above embodiments, the data collection module 310 may include a kernel event collection unit and a program stack information collection unit;

[0097] Based on the above embodiments, the kernel event collection unit can be used to:

[0098] By tracing the software development kit, the eBPF technology is used to collect kernel events in a timely manner, and the kernel events are sent to a ring buffer so that the back-end agent component can obtain the kernel events in the ring buffer;

[0099] The tracking software development kit is deployed in an application container; the kernel events include system call events, CPU switching events, thread information, and link information.

[0100] Based on the above embodiments, the program stack information collection unit can be used to:

[0101] Through the Java process, the stack information and thread information of the program are collected respectively, and the stack information and the thread information are sent to the back-end proxy component; wherein the Java process is deployed in the application container.

[0102] Based on the above embodiments, the kernel event collection unit may be further specifically used for:

[0103] By tracing the software development kit, using the data collection probes deployed at the system call entry and system call exit respectively, the system call entry parameters and system call exit parameters are collected, and a system call event is generated; wherein the system call event includes the system call entry event and exit event.

[0104] Based on the above embodiments, the data processing module 320 can be specifically used for:

[0105] Obtaining kernel events in the ring buffer through a poller in the backend proxy component, and obtaining program stack information through a controller in the backend proxy component;

[0106] Through the backend proxy component, according to the kernel event and program stack information, event data of the CPU switching point and event parameters of each event data;

[0107] Through the backend proxy component, the event data is parsed and the thread data and timestamp information of each event are extracted;

[0108] Through the back-end proxy component, kernel events and program stack information are classified, associated and identified according to the event data, event parameters, thread data and timestamp information of the CPU switching point, and timing information is generated.

[0109] Based on the above embodiments, the program execution process backtracking view includes a thread performance view and a link advanced view;

[0110] Among them, the thread performance view includes a program execution process observation view, a kernel event visualization display, and an indicator data display view; the link advanced view includes a link span view and a link critical moment analysis view.

[0111] The program execution process restoration device provided in the embodiment of the present invention can execute the program execution process restoration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] Embodiment 4

[0113] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0114] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0115] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0116] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the program execution process restoration method described in an embodiment of the present invention. That is:

[0117] Collecting the kernel events and program stack information of the program through a data collection component; wherein the data collection component includes a Java process and a tracking software development kit;

[0118] Through the back-end proxy component, the kernel events and program stack information collected by the data collection component are preprocessed to generate time-series data, and the time-series data is sent to the target database in the program execution process restoration system for storage;

[0119] Through the front-end visual display component, the time-series data is obtained in the target database, and a program execution process backtracking view is generated according to the time-series data for the user to view.

[0120] In some embodiments, the program execution process restoration method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the program execution process restoration method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the program execution process restoration method in any other appropriate manner (for example, by means of firmware).

[0121] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0123] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0124] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0126] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0127] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0128] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for restoring a program execution process, which is executed by a data acquisition component, a back-end proxy component, and a front-end visualization display component in a program execution process restoration system, and is characterized in that: include: Collecting the kernel events and program stack information of the program through a data collection component; wherein the data collection component includes a Java process and a tracking software development kit; Through the back-end proxy component, the kernel events and program stack information collected by the data collection component are preprocessed to generate time-series data, and the time-series data is sent to the target database in the program execution process restoration system for storage; Through the front-end visual display component, the time-series data is obtained in the target database, and a program execution process backtracking view is generated according to the time-series data for the user to view.

2. The method according to claim 1, characterized in that Through the data collection component, the kernel events of the program are collected, including: By tracing the software development kit, the eBPF technology is used to collect kernel events in a timely manner, and the kernel events are sent to a ring buffer so that the back-end agent component can obtain the kernel events in the ring buffer; The tracking software development kit is deployed in an application container; the kernel events include system call events, central processing unit (CPU) switching events, thread information and link information.

3. The method according to claim 2, characterized in that Through the data collection component, the program stack information of the program is collected, including: Through the Java process, the stack information and thread information of the program are collected respectively, and the stack information and the thread information are sent to the back-end proxy component; wherein the Java process is deployed in the application container.

4. The method according to claim 2, characterized in that: Through the tracing SDK, eBPF technology is used to collect kernel events in a timely manner, including: By tracing the software development kit, using the data collection probes deployed at the system call entry and system call exit respectively, the system call entry parameters and system call exit parameters are collected, and a system call event is generated; wherein the system call event includes the system call entry event and exit event.

5. The method according to claim 3, characterized in that: The backend proxy component pre-processes the kernel events and program stack information collected by the data collection component to generate time-series data, including: Obtaining kernel events in the ring buffer through a poller in the backend proxy component, and obtaining program stack information through a controller in the backend proxy component; Through the backend proxy component, according to the kernel event and program stack information, event data of the CPU switching point and event parameters of each event data; Through the backend proxy component, the event data is parsed and the thread data and timestamp information of each event are extracted; Through the back-end proxy component, kernel events and program stack information are classified, associated and identified according to the event data, event parameters, thread data and timestamp information of the CPU switching point, and timing information is generated.

6. The method according to claim 1, characterized in that The program execution process backtracking view includes thread performance view and link advanced view; Among them, the thread performance view includes a program execution process observation view, a kernel event visualization display, and an indicator data display view; the link advanced view includes a link span view and a link critical moment analysis view.

7. A program execution process restoration device, which is executed by the data acquisition component, the back-end proxy component and the front-end visual display component in the program execution process restoration system, characterized in that: include: A data collection module, used to collect kernel events and program stack information of a program through a data collection component; wherein the data collection component includes a Java process and a tracking software development kit; The data processing module is used to pre-process the kernel events and program stack information collected by the data collection component through the back-end proxy component, generate time-series data, and send the time-series data to the target database in the program execution process restoration system for storage; The visualization display module is used to obtain time-series data in the target database through a front-end visualization display component, and generate a program execution process backtracking view based on the time-series data for user viewing.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program execution process restoration method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the program execution process restoration method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the program execution process restoration method according to any one of claims 1 to 6.