Data processing method, system, electronic device, medium and product

By acquiring data from direct-managed memory and mapped memory when a process encounters an exception and storing it as a target file, the problem of incomplete fault data in existing technologies is solved, improving analysis efficiency and accuracy, and enhancing user experience.

CN120723524BActive Publication Date: 2025-11-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511207353.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-11-07
Estimated Expiration
2045-08-27

AI Technical Summary

Technical Problem

Existing technologies cannot collect complete fault data when processes malfunction, resulting in low analysis efficiency.

Method used

When the target process encounters an error, the data of the directly managed memory and the mapped memory are obtained and stored as a target file for subsequent analysis.

Benefits of technology

It improves the completeness and accuracy of fault data analysis, reduces the time users spend perceiving faults, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723524B_ABST
    Figure CN120723524B_ABST
Patent Text Reader

Abstract

The application provides a data processing method, system, electronic device, medium and product. The method comprises the following steps: in the case that an exception occurs in a target process, obtaining memory data based on a management process, wherein the memory data comprises first data of direct management memory and second data of mapping memory; and storing the memory data as a target file based on the management process, wherein the target file is used for exception analysis of the target process. The application can collect relatively complete memory data when the target process is abnormal, thereby improving the accuracy of the exception analysis of the target process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of process fault analysis, and in particular to a data processing method and system, an electronic device, a medium and a product. BACKGROUND

[0002] Core dump is a commonly used fault snapshot technology at present and has been used for collecting fault data in many basic application scenarios. In the related art, core dump is used to realize memory data in a process virtual address space, and the memory state of the part is accurately captured to provide data for abnormal analysis of the process.

[0003] The related art cannot collect complete fault data, which affects the analysis efficiency of process abnormalities. SUMMARY

[0004] The present application provides a data processing method and system, an electronic device, a medium and a product to at least solve the problem that the related art cannot collect complete fault data, which affects the analysis efficiency of process abnormalities.

[0005] The present application provides a data processing method applied to a data processing system, the data processing system comprising a management process and a target process, the target process managing a physical memory, the physical memory comprising a direct memory and a mapped memory, the direct memory being memory that is not mapped to a virtual address space, and the mapped memory being memory that is mapped to a virtual address space, the method comprising:

[0006] In the case that the target process has an exception, memory data is acquired based on the management process, the memory data comprising first data of the direct memory and second data of the mapped memory;

[0007] The memory data is stored as a target file based on the management process, the target file being used for abnormal analysis of the target process.

[0008] The present application also provides a data processing device applied to a data processing system, the data processing system comprising a management process and a target process, the target process managing a physical memory, the physical memory comprising a direct memory and a mapped memory, the direct memory being memory that is not mapped to a virtual address space, and the mapped memory being memory that is mapped to a virtual address space, the device comprising:

[0009] An acquisition module is configured to acquire memory data based on the management process in the case that the target process has an exception, the memory data comprising first data of the direct memory and second data of the mapped memory;

[0010] A storage module is configured to store the memory data as a target file based on the management process, the target file being used for abnormal analysis of the target process.

[0011] The application further provides a data processing system, comprising a management process and a target process, the target process manages physical memory, the physical memory comprises direct memory and mapping memory, the direct memory is memory which is not mapped to a virtual address space, and the mapping memory is memory which is mapped to a virtual address space, and the data processing system is used for executing steps of the data processing method.

[0012] The application further provides an electronic device, comprising a memory for storing a computer program and a processor for implementing steps of the data processing method when executing the computer program.

[0013] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is used for implementing steps of the data processing method when executed by a processor.

[0014] The application further provides a computer program product, comprising a computer program, and the computer program is used for implementing steps of the data processing method when executed by a processor.

[0015] In the embodiment of the application, when the target process is abnormal, memory data is acquired, the acquired memory data comprises first data of the direct memory and second data of the mapping memory, the integrity of the acquired memory data is improved, the first data of the direct memory and the second data of the mapping memory are stored as a target file, and subsequent abnormal analysis of the target process is facilitated, and in addition, the acquired memory data is relatively complete, and thus the accuracy of the abnormal analysis of the target process is improved. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the application, the drawings required in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0017] Figure 1 A schematic diagram of a data processing method provided by the related technology of the application;

[0018] Figure 2 A schematic diagram of another data processing method provided by the related technology of the application;

[0019] Figure 3 A schematic diagram of a data processing method provided by the embodiments of the application Figure 2 ;

[0020] Figure 4 A flowchart of a data processing method provided by the embodiments of the application Figure 1 ;

[0021] Figure 5 A flowchart of a data processing method provided by an embodiment of the present application Figure 2 ;

[0022] Figure 6 A schematic diagram of a first data structure provided by an embodiment of the present application

[0023] Figure 7 A schematic diagram of a second data structure provided by an embodiment of the present application

[0024] Figure 8 A schematic diagram of a target file provided by an embodiment of the present application

[0025] Figure 9 A schematic diagram of a first offset determination method provided by an embodiment of the present application

[0026] Figure 10 A schematic diagram of a second offset determination method provided by an embodiment of the present application

[0027] Figure 11 A schematic diagram of a data processing apparatus provided by an embodiment of the present application

[0028] Figure 12 A schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0030] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0031] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards of relevant countries and regions, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal.

[0032] In today's rapid development of technology, software systems have deeply integrated into social infrastructure and become the core engine driving various fields. From daily use of mobile applications to industrial control, aerospace, financial transactions and other critical fields, the scale and functional complexity of software systems are growing exponentially. At the same time, the amount of data processing carried by the system continues to rise, and the requirements for performance are becoming increasingly demanding. This complexity brings significant behavioral uncertainty. Even after large-scale verification testing, process abnormal crashes are still difficult to completely avoid. With the widespread application of direct memory management technologies such as zero-copy data transmission and kernel bypass, although the performance bottleneck of traditional memory management has been broken through, new technical challenges have also been brought, namely, how to safely and efficiently save the running snapshot of directly managed memory when the system crashes, has become a technical problem that needs to be solved urgently.

[0033] In related technologies, core dump is a process running state snapshot mechanism provided by the operating system. When a process terminates due to abnormal conditions, the system will save the current memory state, register data, program counter and other key information of the process into a file, forming a detailed "fault scene report". This report provides the running state at the moment of program crash for developers and system administrators, which can help accurately locate the root cause of process exception and provide key basis for program repair and optimization.

[0034] Related technologies configure the processing method of snapshot data through core_pattern (kernel parameter), supporting two main processes: 1, directly write to disk (as shown in Figure 1 ); 2, pass through the pipeline to the user state snapshot processing process for processing (as shown in Figure 2 ).

[0035] Among them, Figure 1 and Figure 2In the prior art, the management process first requests the OS (Operating System) to create a main process including multiple threads (such as a main thread, a sub-thread 1 to a sub-thread N, N being a positive integer greater than 1) by a fork function call (a function for creating a new process), the main thread is in a running state, and each sub-thread is in a main loop state, that is, each thread normally executes its own business logic. When an exception occurs in the main process, such as an exception occurring in a thread (such as sub-thread 1), a SIGx DUMP (a signal capable of triggering core dump) signal is triggered, and the abnormal thread (sub-thread 1) enters a kernel mode to perform core dump. First, sub-thread 1 sends a zap (a signal for forcibly terminating a thread) signal to other threads, and after receiving the zap signal, the other threads enter a wait dead (waiting for termination) state and exit after the core dump is completed. Thread 1 collects the state and environment information of each thread, collects the memory information of the main process, and then writes the collected data to the file system of the disk (such as Figure 1 ) or passes the data to a user-mode snapshot processing process through a PIPE (pipe) for processing and then writes the data to the file system (such as Figure 2 ). After the core dump is completed (all data is written to the file system), the other threads are notified to exit through the "complete" in the figure, and then thread 1 exits itself. When thread 1 exits, the main thread sends a SIGCHLD (a process intercommunication signal) signal to the management process to notify that it has exited, so that the management process performs fault processing.

[0036] Based on the related technologies (the prior art Figure 1 and Figure 2 ), core dump mainly focuses on the memory data in the virtual address space of a process, and accurately captures the memory state to provide key data for fault analysis. However, in the face of a process using direct memory management technology, that is, physical memory that is not mapped to the virtual address space, the core dump technology in the related technology has a data collection blind area, which limits the fault snapshot to inevitably have information gaps. When the collected data is deeply analyzed afterwards, some data is missing, which leads to the problem that the root cause of the process exception cannot be accurately determined, greatly affecting the fault repair efficiency and process optimization.

[0037] Based on the above problems, the present application provides a data processing method, which acquires memory data when an exception occurs in a target process, the memory data including first data of direct memory and second data of mapped memory, thereby improving the completeness of the acquired memory data. The complete memory data is stored as a target file, which facilitates subsequent exception analysis of the target process. In addition, since the acquired memory data is relatively complete, the accuracy of the exception analysis of the target process can be improved.

[0038] For those skilled in the art of the technical field, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0039] In combination with the specific application environment architecture or the specific hardware architecture on which the data processing method depends for execution, the specific application environment architecture or the specific hardware architecture is described herein.

[0040] Reference Figure 3 , Figure 3 For an application scenario example of the data processing method, the target process is illustrated in combination with the scenario example, wherein the target process includes multiple threads, such as a main thread a0 and sub-threads a1 to am, and m is an integer greater than 1. The target process is created by the management process through a fork function call. The main thread a0, the sub-thread a1 to the sub-thread am normally run and execute their respective business logic.

[0041] Figure 4 A step flowchart of a data processing method is shown, which is applied to Figure 3 The data processing system shown, specifically comprising the following steps:

[0042] S401, in the case of an exception in the target process, obtaining memory data based on the management process.

[0043] In the embodiments of the present application, the target process manages the physical memory, and the physical memory includes direct memory and mapped memory. The direct memory is the memory that is not mapped to the virtual address space, and the mapped memory is the memory that is mapped to the virtual address space.

[0044] It can be understood that the physical memory is the actual existing hardware memory, wherein the direct memory is the memory that is not mapped to the virtual address space, that is, the target process cannot access the direct memory through the virtual address, and can access the direct memory through a special mechanism, such as a kernel API (Application Programming Interface). The mapped memory is the memory that is mapped to the virtual address space, and the target process can read and write data in the mapped memory through the virtual address. In summary, the direct memory can be directly accessed through the physical address, but cannot be accessed through the virtual address, and the mapped memory can be accessed through the virtual address.

[0045] The memory data includes first data of a direct memory and second data of a mapped memory. The first data includes first metadata and first actual data. The first metadata is data for describing the first actual data. The first actual data is data stored in the direct memory. The first actual data includes running state information and environment information of a first part of the plurality of threads. The second data includes second metadata and second actual data. The second metadata is data for describing the second actual data. The second actual data is data stored in the mapped memory. The second actual data includes running state information and environment information of a second part of the plurality of threads.

[0046] Further, the plurality of threads can be divided into the first part of threads and the second part of threads. The first part of threads corresponds to the direct memory, and the second part of threads corresponds to the mapped memory. For example, referring to Figure 3 , m is 4, the main thread a0, the sub-thread a1 and the sub-thread a2 correspond to the direct memory, the running state information and the environment information of the main thread a0, the sub-thread a1 and the sub-thread a2 are stored in the direct memory, and the sub-thread a3 and the sub-thread a4 correspond to the mapped memory. The running state information and the environment information of the sub-thread a3 and the sub-thread a4 are stored in the mapped memory. Based on this, the first actual data includes the running state information and the environment information of the main thread a0, the sub-thread a1 and the sub-thread a2, and the second actual data includes the running state information and the environment information of the sub-thread a3 and the sub-thread a4.

[0047] In the embodiment of the present application, the running state information of each thread includes a current state mark, a scheduling related mark, a CPU (Central Processing Unit) state, and the like. The current state mark is used to indicate the specific state of the thread when the target process is abnormal, for example, if the thread is executing an instruction when an exception (such as a segment error) is triggered, the state can be "running (Running)". If the process crashes when the thread is blocked due to waiting for a lock, the state can be "blocked (Blocked)". If the thread is terminated by a signal (such as SIGKILL), the state can be "terminating (Terminating)". The scheduling related mark includes the priority of the thread, the scheduling strategy, and whether it is in the "preempted" state. The CPU state includes a register snapshot and instruction stream information. The register snapshot includes the value of the CPU register when the exception occurs, which is used to locate the error. The instruction stream information is used to determine whether the instruction executed by the thread is a illegal instruction. In the embodiment of the present application, the running state information can also include other contents, which are not limited.

[0048] In addition, the environment information of each thread includes: thread identification, target process identification, process group identification to which the target process belongs, and exception occurrence time. The thread identification of the main thread a0 is a0, and the target process exception can be an exception of one or more threads in the target process. In the embodiment of the present application, the environment information can also include other contents, which are not limited.

[0049] In summary, in the embodiment of the present application, the obtained memory data includes the first data of the direct memory and the second data of the mapping memory, which can improve the integrity of the obtained memory data.

[0050] S402, storing the memory data as a target file based on the management process.

[0051] Referring to Figure 3 , after obtaining the memory data, the management process writes the memory data in the form of a target file into the file system.

[0052] The target file is used for the exception analysis of the target process. It can be understood that the target file written into the file system can be used for subsequent exception analysis of the target process.

[0053] In summary, the present application obtains memory data when the target process has an exception, the obtained memory data includes the first data of the direct memory and the second data of the mapping memory, which improves the integrity of the obtained memory data, stores the first data of the direct memory and the second data of the mapping memory as a target file, which is convenient for subsequent exception analysis of the target process, and in addition, the obtained memory data is more complete, which can improve the accuracy of the target process exception analysis.

[0054] Figure 5 A step flowchart of another data processing method is shown, which is applied to Figure 3 the data processing system shown, and specifically includes the following steps:

[0055] S501, in the case that the target process has an exception, based on a thread in a plurality of threads, collecting running state information and environment information of the thread.

[0056] Referring to Figure 3 , when the plurality of threads (the main thread a0, the sub-thread a1 to the sub-thread am) normally run and execute their respective business logic, in the case that the target process has an exception (for example, one of the threads (the sub-thread a1) has an exception), the OS sends a SIGx DUMP signal to the sub-thread a1, and the sub-thread a1 sends a SIGx (a signal for indicating the collection of running state information and environment information) signal to other threads after receiving the SIGx DUMP signal, for indicating other threads to collect thread state and environment information, that is, to collect their own running state information and environment information.

[0057] It can be understood that each thread collects its own running state information and environment information, and the collection is parallel, so that the collection efficiency of the running state information and the environment information of each thread is improved.

[0058] S502, based on the thread, storing the running state information and the environment information in the physical memory.

[0059] In the embodiment, after the running state information and the environment information are collected by each thread, the running state information and the environment information are stored in the direct memory or the mapping memory corresponding to the thread.

[0060] For example, if the main thread a0, the sub-thread a1 and the sub-thread a2 correspond to the direct memory, the running state information and the environment information collected by the main thread a0, the sub-thread a1 and the sub-thread a2 are all stored in the direct memory. If the sub-thread a3 and the sub-thread a4 correspond to the mapping memory, the running state information and the environment information collected by the sub-thread a3 and the sub-thread a4 are all stored in the mapping memory.

[0061] In some embodiments, the storing of the running state information and the environment information in the physical memory comprises: defining a first data structure, the first data structure being used to describe the running state information and the environment information; and instantiating the first data structure in the physical memory.

[0062] It can be understood that after the thread collects the running state information and the environment information, the first data structure is defined based on the running state information and the environment information, and the running state information and the environment information are stored in the physical memory in the form of the first data structure.

[0063] In the embodiment of the present application, for example, in the Figure 6 , the first data structure is defined as an array with a length of 128. It can be understood that Figure 6 , the first data structure of each thread can be defined with reference to Figure 6 .

[0064] In the Figure 6In the above, "struct threadtraceinfo" represents a definition of the first data structure. "pthread_t self" is a pthread handle (pthread_t is a type used to represent a thread identifier) of the thread, which is used to identify the thread. "unsigned int tid" is a thread identifier at a system level. "unsigned long dumptime" is a collection time of the running state information and the environment information of the thread. "unsigned long rip" is a record of an instruction pointer, which is a pointer to a next instruction to be executed, and can be used to locate a code position when an exception occurs in the target process. "unsigned long rbp" is a record of a base pointer, which is used to point to a bottom of a stack frame and assist a stack backtracking. "unsigned long rax" is a record of an accumulator register. "unsigned long rdi" is a record of a first parameter register. "unsinged long rsi" is a record of a second parameter register. "unsigned long rdx" is a record of a data register. "unsinged long rcx" is a record of a counter register. "unsinged long rsp" is a record of a stack pointer register. "struct threadtraceinfo threads

[128] " represents a definition of an array with a length of 128, which can store running state information and environment information of 128 threads at most.

[0065] It can be understood that, in the above, Figure 6 the array with a length of 128 is defined by a static application mode, and the array supports multiple threads, and each thread can use one of the arrays to store its own running state information and environment information.

[0066] Further, if the number of threads included in the target process is greater than 128, the array size of the first data structure can be expanded as needed. In addition, the first data structure can also be defined by a dynamic application mode.

[0067] It can be understood that, in the above, the first data structure can be defined by the static application mode or the dynamic application mode. The first data structure can be used to store the running state information and the environment information of the thread.

[0068] In the embodiment of the present application, a first data structure can be defined based on each thread, and then the first data structure is stored in the corresponding direct management memory or the mapping memory. A first data structure can also be defined based on multiple threads of the corresponding direct management memory. A first data structure can also be defined based on multiple threads of the corresponding mapping memory. For example, refer to the following table 1: Table 1Figure 3 The main thread a0, the sub-thread a1 and the sub-thread a2 correspond to the direct memory, and the running state information and the environment information of the main thread a0, the sub-thread a1 and the sub-thread a2 are defined in the same first data structure, and the first data structure is stored in the direct memory after instantiation. The running state information and the environment information of the sub-thread a3 and the sub-thread a4 are defined in another first data structure, and the first data structure is stored in the mapping memory after instantiation.

[0069] The instantiation of the first data structure in the physical memory can be understood as that, according to the definition of the first data structure, an available object is actually allocated and created in the physical memory to store and operate specific data.

[0070] In the embodiments of the present application, the first data structure can also be other types of data structures, which are not limited herein.

[0071] In some embodiments, after the first data structure is instantiated in the physical memory, the method further includes: determining a storage address of the first data structure in the physical memory; and sending the storage address to the management process, the storage address being used by the management process to obtain the first data structure in the physical memory.

[0072] In the embodiments of the present application, the first data structure can be instantiated by a static application mode or a dynamic application mode, and the instantiation process requires that the storage address of the first data structure is traceable when the target process is abnormal. For the static application mode, the storage address of the first data structure can be determined after the first data structure is compiled, and the management process can obtain the storage address of the first data structure through the symbol table information of the binary file. For the dynamic application mode, after the first data structure is instantiated, the storage address of the first data structure can be sent to the management process through the IPC (Inter-Process Communication) or other means (such as a shared file of a virtual device), so that the management process saves the storage address.

[0073] It can be understood that, for the first data structure determined by the static application mode, the target process does not need to send the storage address to the management process. For the first data structure determined by the dynamic application mode, the storage address is sent to the management process after the first data structure is stored.

[0074] Further, the management process can obtain the first data structure in the physical memory according to the storage address after the storage address is included, to obtain the memory data.

[0075] S503, the target process exits the running, and sends an exit signal to the management process based on the target process.

[0076] Referring to Figure 3The target process exits running after collecting the running state information and the environment information of each thread. The target process exiting running refers to releasing the target process, and the target process can be called by other programs.

[0077] In addition, the main thread in the target process can send an exit signal to the management process, and the exit signal can be a SIGCHLD signal.

[0078] S504, performing fault processing on the target process based on the exit signal.

[0079] It can be understood that the management process performs fault processing on the target process after receiving the exit signal. The fault processing includes fault warning, that is, informing the user of the existence of a fault and a fault type. The fault type is, for example, program crash, service unavailability, or performance anomaly. In addition, the fault processing also includes fault repair or recovery, such as restarting the service or the target process. In the embodiments of the present application, the specific implementation of the fault processing is not limited.

[0080] In the embodiments of the present application, after collecting the running state information and the environment information of each thread, the target process (which can be based on the main thread) sends an exit signal to the management process, and the management process performs fault processing at this time. Compared with the prior art, the target process sends the exit signal to the management process after writing the running state information and the environment information of each thread in the file system, so that the present application can reduce the perception time of the user to the fault and improve the user experience. Figure 1 and Figure 2 The main process sends an exit signal to the management process after writing the running state information and the environment information of each thread in the file system, so that the present application can reduce the perception time of the user to the fault and improve the user experience.

[0081] S505, receiving the filtering strategy sent by the target process based on the management process.

[0082] In some embodiments, the target process also sends a filtering strategy to the management process before exiting, and the filtering strategy is used to instruct the management process to obtain specified data in the physical memory.

[0083] S506, obtaining memory data based on the management process according to the filtering strategy.

[0084] The filtering strategy is used to instruct the management process to obtain the memory data in the physical memory. It can be understood that the obtained memory data is the data specified by the filtering strategy in the physical memory.

[0085] In some embodiments, the filtering strategy includes address information, and the management process obtains data corresponding to the address information in the physical memory as the memory data.

[0086] In some embodiments, the filtering strategy includes a data type (such as CPU state), and the management process obtains data of the data type in the physical memory as the memory data.

[0087] In the embodiments of the present application, the filtering policy can further include other contents, which are not limited herein.

[0088] In some embodiments, the data processing system further includes: a virtual device, the first data being obtained by: based on the management process, mapping the first data to a virtual address space of the management process through a shared file of the virtual device; and based on the management process, obtaining the first data according to the virtual address space of the management process.

[0089] In the embodiments of the present application, the shared file of the virtual device is used to realize the sharing of the first data. Specifically, the management process can obtain the first data through the shared file of the virtual device.

[0090] The target process is configured to map the first storage area in the direct memory and perform an initialization operation on the first storage area, and the first storage area is configured to store the first data. The virtual device is used as an interactive channel between the kernel mode and the user mode, and is configured to manage the first storage area and provide a control interface to receive control commands of the management process and the target process. The management process is configured to obtain the first data through the shared file of the virtual device when the target process is abnormal.

[0091] It can be understood that, in the present application, the shared file of the virtual device is used for the interaction between the kernel mode and the user mode. The management process is in the user mode, and the direct memory is in the kernel mode. The management process cannot directly obtain the first data of the direct memory. Therefore, the management process can map the first data to a virtual address space of the management process through the shared file of the virtual device, and then obtain the first data according to the virtual address space of the management process.

[0092] In some embodiments, the data processing system further includes: a virtual device, the second data being obtained by: based on the management process, anchoring the second data through a shared file of the virtual device; and based on the management process, obtaining the second data through the shared file.

[0093] In the embodiments of the present application, before the target process exits, the management process can anchor the second data through the shared file of the virtual device, so as to avoid that the target process releases the second data after exiting.

[0094] Specifically, anchoring the second data in the shared file can be understood as storing the second data in the shared file. When the memory data is obtained, the second data can be obtained in the shared file.

[0095] In the embodiment of the present application, the execution flow of the target process is as follows: (1) the target process starts; (2) the target process performs necessary initialization operations; (3) the target process remaps the first data of the direct management memory; (4) the target process initializes the direct management memory; (5) the target process performs business processing; (6) whether the target process is abnormal during the business processing, if not, performing (5), if yes, performing (7); (7) each thread collects its own running state information and environment information; (8) storing the collected running state information and environment information in the direct management memory and / or the mapped memory; (9) performing other tasks; and (10) the target process ends running.

[0096] In the embodiment of the present application, the execution flow of the virtual device is as follows: (1) applying for a storage space of the first data of the direct management memory; (2) implementing a control interface; (3) judging whether a control instruction of the target process or the management process is received, if not, performing (3), if yes, performing (4); (4) the virtual device executing the control instruction; and (5) ending running after the control instruction is executed, if the control instruction is not executed, continuing to perform (4).

[0097] In the embodiment of the present application, the execution flow of the management process is as follows: (1) the management process starts; (2) the management process performs necessary initialization operations; (3) the management process performs tasks; (4) the management process listens to the target process, listening whether the target process exits, if yes, performing (5), if not, performing (3); (5) determining whether the target process exits abnormally, if yes, performing (6), if not, the management process ends running; (6) the management process obtaining memory data; and (7) storing the memory data as a target file.

[0098] In the embodiment of the present application, the target process and the management process can perform respective tasks, and the target process and the management process can also send a control instruction to the virtual device to control the virtual device to execute the control instruction, and the present application does not limit the specific content of the control instruction.

[0099] S507, defining a second data structure based on the management process.

[0100] The second data structure is used for describing the memory data.

[0101] In some embodiments, the second data structure includes at least one of a memory page, description information of the memory page, virtual memory region information of the target process, and information of a dynamic library loaded in the physical memory.

[0102] In the embodiment of the present application, after the memory data is obtained in the physical memory, the second data structure is defined.

[0103] In the embodiments of the present application, the memory data includes metadata of the physical memory and actual data of the physical memory, the metadata of the physical memory includes first metadata of the direct memory and second metadata of the mapped memory, and the actual data of the physical memory includes first actual data of the direct memory and second actual data of the mapped memory.

[0104] In the embodiments of the present application, the second data structure is defined to facilitate the recording of the memory data. For example, one second data structure refers to Figure 7 In the embodiments of the present application, the second data structure is defined to facilitate the recording of the memory data. For example, one second data structure refers to Figure 7 In the embodiments of the present application, the second data structure is defined to facilitate the recording of the memory data. For example, one second data structure refers to In the embodiments of the present application, the second data structure is defined to facilitate the recording of the memory data. For example, one second data structure refers to In the embodiments of the present application, the second data structure is defined to facilitate the recording of the memory data. For example, one second data structure refers to

[0105] S508, storing the second data structure as a target file based on the management process.

[0106] Referring to Figure 3 , the management process writes the second data structure into the file system, and stores the memory data in the format of the target file in the file system.

[0107] In some embodiments, S508 includes: storing the second data structure as a target file after formatting; wherein the target file includes: a file header structure of the target file, the file header structure being used to record the metadata; and a file overall structure, the file overall structure being a structured description of the actual data. In some embodiments, S508 includes: storing the second data structure as a target file after formatting; wherein the target file includes: a file header structure of the target file, the file header structure being used to record the metadata; and a file overall structure, the file overall structure being a structured description of the actual data.

[0108] In the embodiments of the present application, the target file is editable, and the content therein can be deleted according to requirements, and the specific deletion manner is not limited herein.

[0109] In some embodiments, the file header structure comprises at least one of the following: a file signature, a version number, a creation time, a total number of memory pages, a number of virtual memory areas, and a number of pages of loading information.

[0110] For example, referring to Figure 8 , a target file is shown, in which "struct filehdr" represents a file header structure of the target file, and the file header structure comprises a plurality of metadata of memory data, respectively "unsinged char signature

[16] ", "unsigned long version", "unsigned long dumptime", "unsigned long numavmas", and "unsigned long ldinfopgs". Among them, "unsinged char signature

[16] " represents a file signature of 16 bytes, used to identify the file format of the target file. "unsigned long version" represents a version number of the target file. "unsigned long dumptime" represents a creation time of the target file. "unsigned long numpages" represents a total number of memory pages contained in the target file. "unsigned long numavmas" represents a number of virtual memory areas (VMA). "unsigned long ldinfopgs" represents a number of pages of loading information (ldinfo).

[0111] In some embodiments, the file overall structure comprises at least one of the following:

[0112] a file header part;

[0113] a memory page structure array for storing actual data memory pages;

[0114] a loading information structure array comprising loading information;

[0115] a page information table for recording metadata of each memory page;

[0116] a virtual memory area information array for describing virtual memory areas of a target process.

[0117] For example, referring to Figure 8"struct file" represents the file structure, which includes "struct filehdr hdr", "struct page pg[X]", "struct loadinfo ldinfo[Y]", "struct pageinfo pit[X + hdr.ldinfopgs]", and "struct vmainfo vmas[Z]".

[0118] "struct filehdr hdr" represents the file header section, which contains all metadata of the file header structure.

[0119] "struct page pg[X]" represents the memory page structure array, X = hdr.numpages (the total number of memory pages specified in the file header structure), which is used to store the actual memory page content.

[0120] "struct loadinfo ldinfo[Y]" represents the load information structure array, "size aligned to pagesize" means that the size of Y is page size aligned to ensure that the size of Y is an integer multiple of the page size, and further, Y is the number of load information entries, Y = actual record number + 1, where 1 means that there is a NULL (null) end marker as an additional "entry". Where Y satisfies the following expression (1):

[0121]

[0122] In the above expression (1), represents the size (number of bytes) of a single ldinfo structure, represents a memory page, represents the size of a single memory page. represents the total number of pages allocated to the ldinfo array recorded in the file header structure.

[0123] "struct pageinfo pit[X + hdr.ldinfopgs]" represents the page information table, the total size = memory page number (X) + load information page number, which is used to record the meta information of each page.

[0124] "struct vmainfo vmas[Z]" represents the virtual memory area information array, Z = hdr.numavmas (the number of VMAs specified in the file header structure), which is used to describe the virtual memory area of the target process.

[0125] In some embodiments, the method further comprises: obtaining the first reference identifier; searching for the corresponding first page index in the page information table according to the first reference identifier; obtaining a first byte size of the file header structure; obtaining a second byte size of each memory page; determining the first offset according to the first byte size, the second byte size, and the first page index; and obtaining the first target data in the target file according to the first offset, the first target data corresponding to the data in the direct memory.

[0126] In the embodiments of the present application, the page information table includes a plurality of page indexes, and the plurality of page indexes correspond to a plurality of reference identifiers one by one.

[0127] The first reference identifier can be specified by a user when viewing the target file. For example, after the first data is stored as a target file, the first data is divided into a plurality of memory pages, each memory page includes part of the data in the first data, and each memory page corresponds to a reference identifier. The first reference identifier can be at least one of the reference identifiers.

[0128] It can be understood that for the direct memory, tgtvref is the first reference identifier of part of the first actual data, and the first page index (idx) can be obtained by comparing tgtvref and a plurality of vref, and the first offset in the target file is further obtained.

[0129] Referring to Figure 9 , content a1 indicates that the corresponding first page index is searched for in the page information table (struct pageinfo pit[X + hdr.ldinfopgs]) through the first reference identifier (tgtvref). If found, the first page index (idx) in the memory page structure array (struct page pg[X]) is returned, and -1 is returned if failed.

[0130] Further, in Figure 9 , content a2 indicates that the first offset in the target file is calculated. In which, Figure 9 In the above, "sizeof(filehdr) i indicates the file header structure size (first byte size) of the target file, "idx" indicates the first page index, sizeof(struct page) indicates the size (second byte size) of each memory page. "offset" indicates the first offset, wherein offset= sizeof(filehdr)+ sizeof(struct page)×idx.

[0131] It can be understood that the data of a specified size obtained from the first offset in the target file can be the first target data.

[0132] In summary, in Figure 9The application needs to recover the data of the straight pipe memory from the target file, needs to pass through the first reference identifier, and then uses Figure 9 The corresponding first target data is obtained in the manner shown in the figure.

[0133] It can be understood that the first target data is at least part of the first actual data. In the embodiment of the application, the first target data is obtained in the manner shown in the figure. Figure 9 As shown in the figure, the first target data of the straight pipe memory can be efficiently retrieved in the target file.

[0134] In some embodiments, the method further comprises: obtaining a virtual address; determining a target virtual memory region in the virtual memory region information array according to the virtual address, the target virtual memory region including the virtual address; determining a second reference identifier in the target virtual memory region; and obtaining second target data in the target file according to the second reference identifier, the second target data being data in the corresponding mapping memory.

[0135] The virtual address can be specified by a user viewing the target file, for example, the virtual address is an address pointed to by a stack pointer of an abnormal thread, the user selects the virtual address, and then determines the second target data corresponding to the virtual address, so as to analyze the second target data.

[0136] In the embodiment of the application, the target file stores information of a plurality of virtual memory regions, each virtual memory region has a corresponding virtual address, the virtual memory region can be determined according to the virtual address, in addition, the virtual memory region and a plurality of reference identifiers of the mapping memory are in one-to-one correspondence, so the second reference identifier can be determined in the target virtual memory region, and the second target data can be obtained according to the second reference identifier subsequently.

[0137] In some embodiments, obtaining the second target data in the target file according to the second reference identifier comprises: finding a corresponding second page index in the page information table according to the second reference identifier; obtaining a first byte size of the file header structure; obtaining a second byte size of each memory page; obtaining a start address of the target virtual memory region; determining a second offset according to the virtual address, the start address, the first byte size, the second byte size, and the second page index; and obtaining the second target data in the target file according to the second offset.

[0138] Refer to Figure 10, "va" represents a virtual address, and content b1 represents determining a target virtual memory area corresponding to the virtual address "va" from a virtual memory area array ("struct vmainfo vmas[Z]") and returning a pointer thereof. Among them, the virtual memory area (VAM) is a segment of the virtual address space corresponding to the mapped memory, and each VAM is described by start (start address) and len (length). The specific logic is to traverse all virtual memory areas (vmas[0] to vmas[Z-1], Z is the total number of virtual memory areas). For each VAM, check if va satisfies start ≤ va < start + len (address range judgment). If found, return the address of the target virtual memory area, otherwise return NULL (indicating that va is not in any virtual memory area).

[0139] Further, content b2 represents calculating a second offset according to the virtual address "va". The specific logic is that first, findvmafromva(va) is called to obtain the target virtual memory area containing va, and then findpgidxfromvref is called through vma.vref (the second reference identifier associated with the target virtual memory area) to obtain the subscript pgidx of the memory page in the page information table (struct pageinfo pit[X + hdr.ldinfopgs]). Then, offsetfrompgidx(pgidx) is called to obtain the start offset (pgoff) of the memory page in the target file. In addition, "va - vma.start" is the relative offset of va in the vma region, and the sum of the start offset and the relative offset is the second offset corresponding to va.

[0140] It can be understood that the second offset (P2) is calculated as follows: P2= pgoff + (va-vma.start). Wherein, pgoff= sizeof(filehdr)+ sizeof(struct page)×pgidx, va represents a virtual address, and vma.start represents the start address of the target virtual memory area.

[0141] In the embodiments of the present application, for the mapped memory, the corresponding target virtual memory area needs to be found according to the virtual address first, and then the start offset of the memory page in the target file is added to the offset of the virtual address in the target virtual memory area to obtain the second offset. Then the specified size of data in the target file starting from the second offset can be obtained as the second target data of the mapped memory.

[0142] It can be understood that the second target data is at least part of the second actual data. In the embodiment of the present application, the second target data of the mapping memory can be efficiently retrieved in the target file in the manner shown in the following. Figure 10

[0143] In summary, the present application can collect the first data of the straight pipe memory, thereby improving the completeness of the obtained memory data. In addition, the present application anchors the second data of the mapping memory through the shared file of the virtual device, thereby ensuring that the target process can collect the second data of the mapping memory in an exception, and further improving the completeness of the obtained memory data.

[0144] Further, the present application collects the running state information and the environment information of each thread in parallel, thereby improving the collection efficiency of the running state information and the environment information. In addition, the SIGCKLD signal can be triggered when the thread stores the running state information and the environment information into the physical memory, without waiting for the collected data to be written into the target file, so that the management process can realize fast fault perception, shorten the exception response time, and further improve the real-time performance of fault processing.

[0145] The present application also supports configuring a filtering strategy, which can specify the collected memory data according to the filtering strategy, thereby reducing the transmission and storage overhead of redundant data, and improving the data processing efficiency while ensuring the completeness of the memory data.

[0146] The target file of the present application can be identified by reference and virtual address mapping, thereby establishing the associativity between the memory data in the physical memory and the target file, improving the retrieval efficiency of the memory data in the target file while ensuring the completeness of the data.

[0147] Finally, the present application can combine the running state information and the environment information collected by each thread as memory data, and store them as a target file together, without the need for the running state information and the environment information collected by each thread to be stored separately, thereby improving the data processing efficiency.

[0148] It should be noted that the data processing apparatus shown in the embodiment of the present application can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be described here in detail.

[0149] Figure 11 The structure of the data processing apparatus provided in the embodiment of the present application is shown in the following. Figure 11 The embodiment of the present application also provides a data processing apparatus, which can include an acquisition module 111 and a storage module 112, wherein:

[0150] ​The acquisition module 111 is configured to acquire, based on the management process, memory data in the case where the target process has an exception, the memory data including first data of straight-piped memory and second data of mapped memory.

[0151] The storage module 112 is configured to store, based on the management process, the memory data as a target file for exception analysis of the target process.

[0152] Optionally, the acquisition module 111 is specifically configured to receive, based on the management process, a filtering strategy sent by the target process.

[0153] The management process acquires the memory data in the physical memory according to the filtering strategy.

[0154] Optionally, the memory data includes running state information and environment information of each thread in the plurality of threads, and the data processing system further includes a collection module (not shown in the figure) configured to collect, based on a thread in the plurality of threads, the running state information and the environment information of the thread before the memory data is acquired based on the management process.

[0155] The storage module (not shown in the figure) is configured to store, based on the thread, the running state information and the environment information in the physical memory.

[0156] Optionally, the storage module is specifically configured to:

[0157] define a first data structure, the first data structure being used to describe the running state information and the environment information;

[0158] instance the first data structure in the physical memory.

[0159] Optionally, the data processing system further includes a determination module (not shown in the figure) configured to determine a storage address of the first data structure in the physical memory after the first data structure is instantiated in the physical memory.

[0160] The sending module (not shown in the figure) is configured to send the storage address to the management process, the storage address being used by the management process to acquire the first data structure in the physical memory.

[0161] Optionally, the sending module is further configured to cause the target process to exit running after the running state information and the environment information are stored in the physical memory based on the thread, and send an exit signal to the management process based on the target process.

[0162] The processing module (not shown in the figure) is configured to perform fault processing on the target process based on the management process according to the exit signal.

[0163] Optionally, the data processing system further includes a virtual device, and the acquisition module 111 is configured to acquire the first data by the following manner:

[0164] mapping the first data to a virtual address space of the management process based on the management process passing the shared file of the virtual device;

[0165] acquiring the first data according to the virtual address space of the management process based on the management process.

[0166] Optionally, the data processing system further comprises a virtual device, and the obtaining module 111 is configured to obtain the second data by the following manner:

[0167] anchoring the second data by the shared file of the virtual device based on the management process;

[0168] acquiring the second data by the shared file based on the management process.

[0169] Optionally, the data processing system further comprises a defining module (not shown in the figure), configured to define a second data structure based on the management process before the management process stores the memory data as the target file, the second data structure being used to describe the memory data.

[0170] The storing module 112 is specifically configured to store the second data structure as the target file based on the management process.

[0171] Optionally, the second data structure comprises at least one of a memory page, description information of the memory page, virtual memory region information of the target process, and dynamic library information loaded in the physical memory.

[0172] Optionally, the memory data comprises metadata and actual data, and the storing module 112 is specifically configured to:

[0173] store the second data structure as the target file after formatting the second data structure;

[0174] The target file comprises:

[0175] a file header structure of the target file, the file header structure being used to record the metadata;

[0176] a file overall structure, the file overall structure being a structured description of the actual data.

[0177] Optionally, the file header structure comprises at least one of a file signature, a version number, a creation time, a total number of memory pages, a number of virtual memory regions, and a number of pages of loading information.

[0178] Optionally, the file overall structure comprises at least one of:

[0179] a file header part;

[0180] a memory page structure array, the memory page structure array being used to store memory pages of the actual data;

[0181] The loading information structure array includes loading information.

[0182] The page information table is used for recording meta information of each memory page.

[0183] The virtual memory region information array is used for describing a virtual memory region of the target process.

[0184] Optionally, the first retrieval module (not shown in the figure) is further included: used for obtaining a first reference identifier; used for searching for a corresponding first page index in the page information table according to the first reference identifier; used for obtaining a first byte size of the file header structure; used for obtaining a second byte size of each memory page; used for determining a first offset according to the first byte size, the second byte size and the first page index; and used for obtaining first target data in the target file according to the first offset, the first target data corresponding to data in the direct management memory.

[0185] Optionally, the second retrieval module (not shown in the figure) is further included: used for obtaining a virtual address; used for determining a target virtual memory region in the virtual memory region information array according to the virtual address, the target virtual memory region including the virtual address; used for determining a second reference identifier in the target virtual memory region; and used for obtaining second target data in the target file according to the second reference identifier, the second target data corresponding to data in the mapping memory.

[0186] Optionally, when the second retrieval module obtains the second target data in the target file according to the second reference identifier, the second retrieval module is specifically used for: searching for a corresponding second page index in the page information table according to the second reference identifier; obtaining the first byte size of the file header structure; obtaining the second byte size of each memory page; obtaining a start address of the target virtual memory region; determining a second offset according to the virtual address, the start address, the first byte size, the second byte size and the second page index; and obtaining the second target data in the target file according to the second offset.

[0187] It should be noted that the data processing apparatus shown in the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be described here in detail.

[0188] Figure 12 The structure schematic diagram of the electronic device provided by the present application is shown in FIG. 1. Figure 12 As shown in FIG. 1, the electronic device 120 provided by the present embodiment includes at least one processor 1201 and a memory 1202. The processor 1201 and the memory 1202 are connected through a bus.

[0189] In the specific implementation process, the at least one processor 1201 executes the computer execution instructions stored in the memory 1202, so that the at least one processor 1201 executes the above-mentioned data processing method embodiments.

[0190] The specific implementation process of the processor 1201 can refer to the method embodiments described above, which have similar implementation principles and technical effects, and details are not described here.

[0191] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0192] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), and an exemplary at least one disk memory.

[0193] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0194] The present application also provides a data processing system, comprising: a management process and a target process, the target process manages a physical memory, the physical memory comprises a direct memory and a mapping memory, the direct memory is a memory not mapped to a virtual address space, and the mapping memory is a memory mapped to a virtual address space, and the data processing system is used to execute the steps of the above data processing method.

[0195] The embodiments of the present application also provide a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein the computer program is set to execute the steps of any one of the above data processing method embodiments when running.

[0196] In an example embodiment, the computer readable storage medium described above can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0197] Embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the steps in any of the data processing method embodiments described above.

[0198] Embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps in any of the data processing method embodiments described above.

[0199] The skilled in the art can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0200] The above has introduced in detail a data processing method provided by the present application. The principle and implementation mode of the present application are described by applying specific examples in this paper, and the above description of the examples is only for helping to understand the method of the present application and its core idea. It should be pointed out that, for the ordinary skilled in the art, without departing from the principle of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A data processing method, characterized by, The application is applied to a data processing system, the data processing system comprises a management process and a target process, the target process manages a physical memory, the physical memory comprises straight-piped memory and mapping memory, the straight-piped memory is memory unmapped to a virtual address space, and the mapping memory is memory mapped to a virtual address space, and the method comprises: In the case that an exception occurs in the target process, memory data is acquired based on the management process, the memory data comprises first data of the straight-piped memory and second data of the mapping memory; The memory data is stored as a target file based on the management process, and the target file is used for exception analysis of the target process; The data processing system further comprises a virtual device, and the first data is acquired by the following way: The first data is mapped to a virtual address space of the management process based on the management process through a shared file of the virtual device; The first data is acquired based on the management process according to the virtual address space of the management process; The second data is acquired by the following way: The second data is anchored based on the management process through a shared file of the virtual device; The second data is acquired based on the management process through the shared file; The first data comprises first metadata and first actual data, the first metadata is data for describing the first actual data, the first actual data is data stored in the straight-piped memory, and the first actual data comprises running state information and environment information of a first part of threads in a plurality of threads; The second data comprises second metadata and second actual data, the second metadata is data for describing the second actual data, the second actual data is data stored in the mapping memory, and the second actual data comprises running state information and environment information of a second part of threads in a plurality of threads.

2. The data processing method according to claim 1, characterized in that, The memory data is acquired based on the management process, comprising: A filtering strategy sent by the target process is received based on the management process; The memory data is acquired in the physical memory based on the management process according to the filtering strategy.

3. The data processing method of claim 1, wherein, The target process comprises a plurality of threads, the memory data comprises running state information and environment information of each thread in the plurality of threads, and before the memory data is acquired based on the management process, the following further comprises: Running state information and environment information of a thread in the plurality of threads are collected based on the thread; The running state information and environment information are stored in the physical memory based on the thread.

4. The data processing method according to claim 3, characterized in that, The running state information and environment information are stored in the physical memory, comprising: A first data structure is defined, the first data structure is used for describing the running state information and the environment information; The first data structure is instantiated in the physical memory.

5. The data processing method according to claim 4, characterized in that, After the first data structure is instantiated in the physical memory, the following further comprises: A storage address of the first data structure in the physical memory is determined; The storage address is sent to the management process, and the storage address is used for the management process to acquire the first data structure in the physical memory.

6. The data processing method according to claim 3, characterized in that, The method further comprises, after storing the running state information and the environment information in the physical memory based on the thread: the target process exits running, and sends an exit signal to the management process based on the target process; the management process performs fault processing on the target process based on the exit signal.

7. The data processing method according to any one of claims 1 to 6, characterized in that, The method further comprises, before storing the memory data as the target file based on the management process: the management process defines a second data structure, the second data structure being used to describe the memory data; the management process stores the second data structure as the target file. The second data structure comprises at least one of the following: a memory page, description information of the memory page, virtual memory region information of the target process, and dynamic library information loaded in the physical memory.

8. The data processing method according to claim 7, characterized in that, The memory data comprises metadata and actual data, and the management process stores the second data structure as the target file by:

9. The data processing method according to claim 7, characterized in that, formatting the second data structure and storing the formatted second data structure as the target file. The target file comprises: a file header structure of the target file, the file header structure being used to record the metadata; a file overall structure, the file overall structure being a structured description of the actual data. The file header structure comprises at least one of the following: a file signature, a version number, a creation time, a total number of memory pages, a number of virtual memory regions, and a number of pages of loading information.

10. The data processing method according to claim 9, characterized in that, The file overall structure comprises at least one of the following:

11. The data processing method according to claim 10, characterized in that, a file header part; a memory page structure array, the memory page structure array being used to store memory pages of the actual data; a loading information structure array, the loading information structure array comprising loading information; a page information table, the page information table being used to record meta-information of each memory page; a virtual memory region information array, the virtual memory region information array being used to describe virtual memory regions of the target process. The method further comprises:

12. The data processing method according to claim 11, characterized in that, obtaining a first reference identifier; finding a corresponding first page index in the page information table based on the first reference identifier; obtaining a first byte size of the file header structure; obtaining a second byte size of each memory page; determining a first offset based on the first byte size, the second byte size, and the first page index; and obtaining first target data in the target file based on the first offset, the first target data corresponding to data in the direct memory. The method further comprises:

13. The data processing method of claim 11, wherein, obtaining a virtual address; determining a target virtual memory region in the virtual memory region information array based on the virtual address, the target virtual memory region comprising the virtual address; determining a second reference identifier in the target virtual memory region; obtaining second target data in the target file based on the second reference identifier, the second target data corresponding to data in the mapped memory. The method of obtaining the second target data in the target file based on the second reference identifier comprises:

14. The data processing method according to claim 13, characterized in that, finding a corresponding second page index in the page information table based on the second reference identifier; obtaining a first byte size of the file header structure; and obtaining a second byte size of each memory page. obtaining a second byte size of each memory page; obtaining a start address of the target virtual memory region; determining a second offset according to the virtual address, the start address, the first byte size, the second byte size and the second page index; obtaining the second target data in the target file according to the second offset.

15. A data processing system comprising: comprising: a management process and a target process, the target process managing physical memory, the physical memory including direct memory and mapped memory, the direct memory being memory not mapped to a virtual address space, the mapped memory being memory mapped to a virtual address space, the data processing system being configured to perform the steps of the data processing method of any one of claims 1 to 14.

16. An electronic device, comprising: comprising: a memory configured to store a computer program; a processor configured to implement the steps of the data processing method of any one of claims 1 to 14 when executing the computer program.

17. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and when the computer program is executed by the processor, the steps of the data processing method of any one of claims 1 to 14 are implemented.

18. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor, and the steps of the data processing method of any one of claims 1 to 14 are implemented.

Citation Information

Patent Citations

  • Abnormal process processing method, related device, equipment and storage medium

    CN117785440A

  • System abnormal data acquisition method and device, electronic equipment and storage medium

    CN118277221A