Data dump method and device, electronic equipment and storage medium

By obtaining the page descriptor of the kernel physical memory, determining and dumping the target physical page data, the problem of large or incomplete data in Kernel Dump is solved, and efficient crash cause analysis is achieved.

CN120371734APending Publication Date: 2025-07-25BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410977299.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

When the Kernel Dump mechanism in the prior art crashes, the Full Dump data volume is large and inconvenient for transmission, while the Mini Dump data is not comprehensive enough, resulting in insufficient analysis of the cause of the crash.

Method used

When the kernel works exceptionally, the target physical page is determined by obtaining the page descriptor of each physical page in physical memory, and dumping its data to disk, excluding unnecessary memory data, and only the data used to analyze the cause of the crash is retained.

Benefits of technology

It realizes reducing the amount of dumped data without affecting the accuracy of the analysis of the cause of the crash, quickly filtering out the key data used for analysis, and improving the efficiency and accuracy of data dumps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371734A_ABST
    Figure CN120371734A_ABST
Patent Text Reader

Abstract

The invention provides a data dump method and device, electronic equipment and a storage medium, and relates to the technical field of computers. Comprising the steps that under the condition that a kernel works abnormally, a page descriptor corresponding to each physical page in a physical memory of the kernel is obtained; determining a target physical page to be dumped from a physical memory of the kernel according to the page descriptor; and dumping the data in the target physical page into a disk. Therefore, the data used for analyzing the crash reason can be determined according to the page descriptor and dumped, so that the data used for analyzing the crash reason can be quickly and comprehensively screened out from a large amount of data, irrelevant memory data can be cut off, and the dumped data volume is reduced while the accuracy and reliability of crash reason analysis are not influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular, to a data dump method, apparatus, electronic device, and storage medium. Background Art

[0002] Kernel dump is a kernel crash dump mechanism that can automatically save kernel dump information when the system crashes for subsequent analysis and debugging.

[0003] In related technologies, Kernel Dump mainly has two modes: Full Dump and Mini Dump. Full Dump means dumping all the data in the physical memory. The dumped data is large and occupies a lot of space, which is not convenient for transmission. Mini Dump, on the other hand, dumps the data in a specified area. These data are completely determined by the user, and the data is incomplete, providing insufficient support for problem analysis. Summary of the Invention

[0004] The present disclosure aims to at least solve one of the technical problems in the related technologies to some extent.

[0005] A first aspect embodiment of the present disclosure provides a data dump method, including:

[0006] When the kernel works abnormally, obtaining a page descriptor corresponding to each physical page in the physical memory of the kernel;

[0007] Determining a target physical page to be dumped from the physical memory of the kernel according to the page descriptor;

[0008] Dumping the data in the target physical page to a disk.

[0009] In some embodiments, the determining a target physical page to be dumped from the physical memory of the kernel according to the page descriptor includes:

[0010] Determining a target physical page for storing kernel state management data according to the status variable in the page descriptor.

[0011] In some embodiments, the determining a target physical page to be dumped from the physical memory of the kernel according to the page descriptor includes:

[0012] Determining a target type corresponding to each physical page according to the page descriptor;

[0013] Determining the physical page whose target type is not the preset type as the target physical page.

[0014] In some embodiments, the preset type includes at least one of the following:

[0015] User page, free page, continuous memory allocator CMA management page, cache page.

[0016] In some embodiments, the obtaining the page descriptor corresponding to each physical page in the physical memory of the kernel includes:

[0017] Obtaining the page descriptor corresponding to each physical page in the physical memory through the Unified Extensible Firmware Interface UEFI.

[0018] The second aspect embodiment of the present disclosure proposes a data dump device, including:

[0019] An obtaining module, configured to obtain the page descriptor corresponding to each physical page in the physical memory of the kernel when the kernel works abnormally;

[0020] A determining module, configured to determine a target physical page to be dumped from the physical memory of the kernel according to the page descriptor;

[0021] A dumping module, configured to dump the data in the target physical page to a disk.

[0022] In some embodiments, the determining module is configured to:

[0023] Determine a target physical page for storing kernel state management data according to the status variable in the page descriptor.

[0024] In some embodiments, the determining module is configured to:

[0025] Determine a target type corresponding to each physical page according to the page descriptor;

[0026] Determine the physical page whose target type is not the preset type as the target physical page.

[0027] In some embodiments, the preset type includes at least one of the following:

[0028] User page, free page, continuous memory allocator CMA management page, cache page.

[0029] In some embodiments, the obtaining module is configured to:

[0030] Obtain the page descriptor corresponding to each physical page in the physical memory through the Unified Extensible Firmware Interface UEFI.

[0031] The third aspect embodiment of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, implementing the data dump method proposed in the first aspect embodiment of the present disclosure.

[0032] In a fourth aspect embodiment of the present disclosure, a computer-readable storage medium is provided, storing a computer program, which when executed by a processor, implements the data dump method proposed in the first aspect embodiment of the present disclosure.

[0033] The data dump method, apparatus, electronic device, and storage medium provided by the present disclosure have the following beneficial effects:

[0034] In the embodiments of the present disclosure, when the kernel works abnormally, the page descriptor corresponding to each physical page in the physical memory of the kernel can be obtained, and then according to the page descriptor, the target physical page to be dumped can be determined from the physical memory of the kernel, and finally the data in the target physical page is dumped to the disk. Thus, the data used for analyzing the crash cause can be determined according to the page descriptor and dumped, so that the data used for analyzing the crash cause can be comprehensively screened out from a large amount of data quickly, and the irrelevant memory data can be trimmed, reducing the amount of dumped data while ensuring the accuracy and reliability of the crash cause analysis.

[0035] The additional aspects and advantages of the present disclosure will be partly given in the following description, partly will become obvious from the following description, or will be understood through the practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The above and / or additional aspects and advantages of the present disclosure will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0037] Figure 1 is a schematic diagram of a data dump scenario;

[0038] Figure 2 is a flowchart of a data dump method provided by an embodiment of the present disclosure;

[0039] Figure 3 is a flowchart of a data dump method provided by an embodiment of the present disclosure;

[0040] Figure 4 is a schematic structural diagram of a data dump apparatus provided by an embodiment of the present disclosure;

[0041] Figure 5 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] Embodiments of the present disclosure will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where like or similar reference numerals denote like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present disclosure and should not be construed as limiting the present disclosure.

[0043] Figure 1 It is a schematic diagram of a data dump scenario; as Figure 1 shown, in the case of a running kernel crashing, the kernel dump information is saved in a dump file of a system snapshot, so that the crash tool will analyze the kernel dump information in the dump file to find out the cause of the crash. Through analysis and debugging, the problem can be quickly located and fixed, thus ensuring the stability and reliability of the system.

[0044] Suppose there is a mobile phone running the Android operating system, with some applications and services running on it. At a certain moment, due to some reason, the system crashes, causing the applications and services to fail to run properly. At this time, it is necessary to analyze and debug the system to find out the cause of the crash and fix it.

[0045] In this case, kernel dump can play a role. When the system crashes, kernel dump will be automatically triggered and the kernel dump information will be saved to a specific file. After saving the kernel dump information, the system will restart, restoring the system to its normal running state.

[0046] Next, a dedicated tool can be used to analyze and debug the saved kernel dump information. For example, the crash tool can be used to analyze the kernel dump information to find out the cause of the crash. Through analysis and debugging, the problem can be quickly located and fixed, thus ensuring the stability and reliability of the system.

[0047] Among them, the crash tool is a widely used analysis tool for Linux kernel crash dump files.

[0048] The following describes a data dump method, apparatus, electronic device, and storage medium according to embodiments of the present disclosure with reference to the accompanying drawings.

[0049] In the embodiments of the present disclosure, it is exemplified that the data dump method is configured in a data dump apparatus, and the data dump apparatus can be applied to any electronic device so that the electronic device can perform the data dump function.

[0050] Figure 2 It is a flowchart of a data dump method provided by an embodiment of the present disclosure.

[0051] As Figure 2 shown, the data dump method may include the following steps:

[0052] Step 201, in the case of a kernel working exception, obtain the page descriptor corresponding to each physical page in the physical memory of the kernel.

[0053] In some embodiments, the memory management method of the kernel is a paged memory management method, that is, the physical memory is divided into pages of a fixed size, and one physical page corresponds to one page descriptor.

[0054] Among them, the page descriptor may include the status information of the physical page, for example, whether it is locked, whether it is modified, whether it is in the active page list, etc.; it may also include the reference count of the physical memory page, which is used for memory recycling and page replacement algorithms; it also includes the mapping relationship between the associated physical memory page and the virtual memory page, etc., and the present disclosure does not limit this.

[0055] In some embodiments, if the kernel is an Android kernel, the Android kernel can be responsible for system startup and management by the Unified Extensible Firmware Interface (UEFI). When the Android kernel crashes, the entire system can be taken over by the UEFI. Therefore, the Android system can perform kernel dump under the UEFI. Therefore, through the Unified Extensible Firmware Interface UEFI, the page descriptor corresponding to each physical page in the physical memory can be obtained.

[0056] Step 202, according to the page descriptor, determine the target physical page to be dumped from the physical memory of the kernel.

[0057] In some embodiments, according to the page descriptor, it can be determined whether the data stored in each physical page can be used to analyze the cause of the system crash, so as to determine the physical page storing the data that can be used to analyze the cause of the system crash as the target physical page to be dumped.

[0058] In some embodiments, all data related to the kernel state can be determined as the data for analyzing the cause of the system crash.

[0059] In some embodiments, the data related to the kernel state management data can also be determined as the data for analyzing the cause of the system crash. Therefore, according to the status variable in the page descriptor, the target physical page for storing the kernel state management data can be determined.

[0060] Among them, the kernel-mode management data mainly refers to the data for the operating system to manage and control various resources (including memory, CPU, peripheral devices, etc.) in the kernel mode of the computer system.

[0061] In some embodiments, the kernel-mode management data may include memory management data, CPU scheduling data, device management data, file system management data, process management data, security management data, and so on. The present disclosure does not make specific limitations thereto.

[0062] Step 203: Dump the data in the target physical page to the disk.

[0063] Among them, the data stored in the disk will not disappear after the system restarts. Therefore, the data in the target physical page can be dumped to the disk to save the target data without affecting the system restart again, and then the saved data can be analyzed to find out the cause of the system crash.

[0064] In the embodiments of the present disclosure, when the kernel works abnormally, the page descriptor corresponding to each physical page in the physical memory of the kernel can be obtained, and then, according to the page descriptor, the target physical page to be dumped can be determined from the physical memory of the kernel. Finally, the data in the target physical page is dumped to the disk. Thus, the data for analyzing the cause of the crash can be determined according to the page descriptor and dumped, so that the data for analyzing the cause of the crash can be comprehensively screened out from a large amount of data quickly, and the irrelevant memory data can be trimmed, reducing the amount of dumped data while ensuring the accuracy and reliability of the analysis of the cause of the crash.

[0065] Figure 3 It is a schematic flowchart of a data dumping method provided by an embodiment of the present disclosure. As Figure 3 shown, the data dumping method may include the following steps:

[0066] Step 301: When the kernel works abnormally, obtain the page descriptor corresponding to each physical page in the physical memory of the kernel.

[0067] Among them, for the specific implementation form of step 301, reference may be made to the detailed descriptions in other embodiments of the present disclosure, and details are not described herein again.

[0068] Step 302: Determine the target type corresponding to the physical page according to the page descriptor.

[0069] In some embodiments, the target type of the physical page can be determined according to the status variable in the page descriptor.

[0070] Among them, the target type includes but is not limited to: user page, free page, continuous memory allocator (CMA) management page, cache page, system page, index page, and so on.

[0071] Among them, the user page is a page in physical memory used to store user programs and data (such as data and code of application programs). In some embodiments, it can be determined whether a physical page is a user page based on the access permissions (such as readable, writable, executable) in the page descriptor and whether it belongs to the memory space of a certain user process.

[0072] Among them, the free page refers to a page in physical memory that has not been allocated to any process or data structure. They are in an unused state and can be allocated to new requests at any time. In some embodiments, free pages can be determined by the status bits (such as "free" or "unused") in the page descriptor.

[0073] Among them, the CMA management page refers to the physical memory page reserved and managed by CMA. CMA allows memory to be allocated to device drivers that require continuous large chunks of memory when memory fragmentation is severe. In some embodiments, CMA management pages can be determined by the pointer in the page descriptor that points to a specific memory area or management structure.

[0074] Among them, the cache page refers to a page reserved in physical memory by the operating system to improve data access speed. These pages may contain recently accessed data or code for quick access when needed. In some embodiments, cache pages can be determined by the content of the physical page (such as whether it contains data from the disk) and whether it is managed by the cache manager.

[0075] Among them, the system page is a physical page used by the database storage engine or other systems to manage physical pages and other system resources. In some embodiments, system pages can be determined by the permission bits (such as whether it is executable) in the page descriptor and whether it belongs to the kernel memory area.

[0076] Among them, the index page is a physical page used to store the index structure. An index is a data structure used in a database or file system to accelerate data retrieval.

[0077] Step 303: Determine the target physical page as the physical page whose target type is not the preset type.

[0078] In some embodiments, since there are many data types for analyzing the cause of system crashes and they are stored in different physical pages respectively, while there are fewer data types that are not used for analyzing the cause of system crashes and they occupy more physical pages. Therefore, in the embodiments of the present disclosure, the target physical page can be quickly and simply determined by excluding the data that is not used for analyzing the cause of system crashes.

[0079] In some embodiments, the preset type may include at least one of the following: user page, free page, continuous memory allocator CMA management page, cache page.

[0080] Step 304, dump the data in the target physical page to the disk.

[0081] In the embodiments of the present disclosure, in the case of abnormal kernel operation, obtain the page descriptor corresponding to each physical page in the physical memory of the kernel, then determine the target type corresponding to each physical page according to the page descriptor, and determine the physical page whose target type is not the preset type as the target physical page, and finally dump the data in the target physical page to the disk. Thus, by excluding data with few types, occupying more physical pages, and being useless for system crash analysis, the target physical page can be screened more quickly and accurately, further improving the efficiency of data dumping.

[0082] To implement the above embodiments, the present disclosure also proposes a data dumping device.

[0083] Figure 4 It is a schematic structural diagram of the data dumping device provided by the embodiments of the present disclosure.

[0084] As Figure 4 shown, the data dumping device 400 may include:

[0085] An obtaining module 401, configured to obtain the page descriptor corresponding to each physical page in the physical memory of the kernel in the case of abnormal kernel operation;

[0086] A determining module 402, configured to determine the target physical page to be dumped from the physical memory of the kernel according to the page descriptor;

[0087] A dumping module 403, configured to dump the data in the target physical page to the disk.

[0088] In some embodiments, the determining module 402 is configured to:

[0089] Determine the target physical page for storing kernel state management data according to the status variable in the page descriptor.

[0090] In some embodiments, the determining module 402 is configured to:

[0091] Determine the target type corresponding to each physical page according to the page descriptor;

[0092] Determine the physical page whose target type is not the preset type as the target physical page.

[0093] In some embodiments, the preset type includes at least one of the following:

[0094] User page, free page, continuous memory allocator CMA management page, cache page.

[0095] In some embodiments, the obtaining module 401 is configured to:

[0096] Through the Unified Extensible Firmware Interface (UEFI), obtain the page descriptor corresponding to each physical page in the physical memory.

[0097] For the functions and specific implementation principles of the above-mentioned modules in the embodiments of the present disclosure, reference may be made to the above-mentioned method embodiments, and details are not described herein again.

[0098] The data dumping device in the embodiments of the present disclosure can first obtain the page descriptor corresponding to each physical page in the physical memory of the kernel when the kernel works abnormally, and then determine the target physical pages to be dumped from the physical memory of the kernel according to the page descriptor. Finally, dump the data in the target physical pages to the disk. Thus, the data for analyzing the crash cause can be determined according to the page descriptor and dumped, so that the data for analyzing the crash cause can be comprehensively screened out from a large amount of data quickly, and the irrelevant memory data can be trimmed, reducing the amount of dumped data while ensuring the accuracy and reliability of the crash cause analysis.

[0099] To implement the above embodiments, the present disclosure also proposes an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the data dumping method proposed in the foregoing embodiments of the present disclosure.

[0100] To implement the above embodiments, the present disclosure also proposes a computer-readable storage medium storing a computer program, which when executed by a processor, implements the data dumping method proposed in the foregoing embodiments of the present disclosure.

[0101] Figure 5 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 5 The shown electronic device 12 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0102] As Figure 5 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0103] Bus 18 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, an Accelerated Graphics Port, a processor bus, or a local bus using any of the various bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnection (PCI) bus.

[0104] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and nonvolatile media, removable and non-removable media.

[0105] Memory 28 can include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache memory 32. Electronic device 12 can further include other removable / non-removable, volatile / nonvolatile computer system storage media. By way of example only, storage system 34 can be used for reading and writing on non-removable, nonvolatile magnetic media ( Figure 5 not shown and typically called a "hard disk drive"). Although Figure 5 not shown in the figure, a disk drive for reading and writing on removable nonvolatile disks (such as a "floppy disk"), and an optical disk drive for reading and writing on removable nonvolatile optical disks (such as Compact Disc Read Only Memory (CD-ROM), Digital Video Disc Read Only Memory (DVD-ROM), or other optical media) can be provided. In these cases, each drive can be connected to bus 18 through one or more data media interfaces. Memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0106] A program / utilities 40 having a set (at least one) of program modules 42 can be stored, for example, in a memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally execute the functions and / or methods in the embodiments described in this disclosure.

[0107] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 22. Also, the electronic device 12 can communicate with one or more networks (such as a Local Area Network (LAN), a Wide Area Network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0108] The processing unit 16 executes various functional applications and data dumps by running programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0109] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0110] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0111] Any process or method description represented in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code that includes one or more executable instructions for implementing a customized logical function or process. The scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed, as should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.

[0112] The logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing a logical function and can be specifically implemented in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0113] It should be understood that various parts of the present disclosure can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following techniques known in the art or a combination thereof can be used: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0114] Those of ordinary skill in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0115] In addition, in each of the embodiments of the present disclosure, the functional units can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. When the above integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0116] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A data dump method, characterized in that, The method includes: When the kernel has a working anomaly, obtaining a page descriptor corresponding to each physical page in the physical memory of the kernel; Determining, according to the page descriptor, a target physical page to be dumped from the physical memory of the kernel; Dumping the data in the target physical page to a disk.

2. The method according to claim 1, wherein The determining, according to the page descriptor, a target physical page to be dumped from the physical memory of the kernel includes: Determining, according to a status variable in the page descriptor, a target physical page for storing kernel-mode management data.

3. The method according to claim 1, characterized in that, The determining, according to the page descriptor, a target physical page to be dumped from the physical memory of the kernel includes: Determining, according to the page descriptor, a target type corresponding to each physical page; Determining a physical page whose target type is not a preset type as the target physical page.

4. The method according to claim 3, wherein The preset type includes at least one of the following: User page, free page, continuous memory allocator (CMA) management page, cache page.

5. The method according to claim 1, wherein The obtaining a page descriptor corresponding to each physical page in the physical memory of the kernel includes: Obtaining, through the Unified Extensible Firmware Interface (UEFI), a page descriptor corresponding to each physical page in the physical memory.

6. A data dump device, characterized in that, The apparatus includes: An obtaining module, configured to obtain a page descriptor corresponding to each physical page in the physical memory of the kernel when the kernel has a working anomaly; A determining module, configured to determine, according to the page descriptor, a target physical page to be dumped from the physical memory of the kernel; A dumping module, configured to dump the data in the target physical page to a disk.

7. The device according to claim 6, characterized in that, The determining module is configured to: Determine, according to a status variable in the page descriptor, a target physical page for storing kernel-mode management data.

8. The device according to claim 6, characterized in that, The determining module is configured to: Determine, according to the page descriptor, a target type corresponding to each physical page; Determine a physical page whose target type is not a preset type as the target physical page.

9. The device according to claim 8, characterized in that, The preset type includes at least one of the following: User page, free page, continuous memory allocator (CMA) management page, cache page.

10. The device according to claim 6, characterized in that The obtaining module is configured to: Obtain, through the Unified Extensible Firmware Interface (UEFI), a page descriptor corresponding to each physical page in the physical memory.

11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the data dumping method according to any one of claims 1-5.

12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data dumping method according to any one of claims 1-5.